diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c index 676f88f2b73..01788a1d3d2 100644 --- a/src/mame/drivers/pgm.c +++ b/src/mame/drivers/pgm.c @@ -1399,6 +1399,36 @@ static DRIVER_INIT( kov2 ) pgm_kov2_decrypt(machine); } +static DRIVER_INIT( kov2p ) +{ +// this hacks the identification of the kov2 rom to return the string required for kov2p +// this is _NOT_ appropriate for use in MAME, the internal rom should be dumped. +#if 0 + UINT8 *mem8 = (UINT8 *)memory_region(machine, "user1"); + pgm_basic_init(machine); + pgm_kov2p_decrypt(machine); + + mem8[0xDE] = 0xC0; + mem8[0xDF] = 0x46; + mem8[0x4ED8] = 0xA8;// B0 + mem8[0x4EDC] = 0x9C;// A4 + mem8[0x4EE0] = 0x5C;// 64 + mem8[0x4EE4] = 0x94;// 9C + mem8[0x4EE8] = 0xE8;// F0 + mem8[0x4EEC] = 0x6C;// 74 + mem8[0x4EF0] = 0xD4;// DC + mem8[0x4EF4] = 0x50;// 58 + mem8[0x4EF8] = 0x80;// 88 + mem8[0x4EFC] = 0x9C;// A4 + mem8[0x4F00] = 0x28;// 30 + mem8[0x4F04] = 0x30;// 38 + mem8[0x4F08] = 0x34;// 3C + mem8[0x4F0C] = 0x1C;// 24 + mem8[0x1FFFFC] = 0x33; + mem8[0x1FFFFD] = 0x99; +#endif +} + static DRIVER_INIT( martmast ) { pgm_basic_init(machine); @@ -3266,7 +3296,48 @@ ROM_START( kov2p ) ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ /* not correct for this set, needs dumping from internal rom */ - ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, BAD_DUMP CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) // NOT for this version, works with a patch + //ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, BAD_DUMP CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) // NOT for this version, works with a hack + ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, NO_DUMP ) + + ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */ + ROM_LOAD( "v200-16.rom", 0x000000, 0x200000, CRC(16a0c11f) SHA1(ce449cef76ebd5657d49b57951e2eb0f132e203e) ) + + ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ + ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS) + ROM_LOAD( "t1200.rom", 0x400000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) + + ROM_REGION( 0xc00000/5*8, "gfx2", ROMREGION_DISPOSE | ROMREGION_ERASEFF ) /* Region for 32x32 BG Tiles */ + /* 32x32 Tile Data is put here for easier Decoding */ + + ROM_REGION( 0x2800000, "gfx3", 0 ) /* Sprite Colour Data */ + ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) + ROM_LOAD( "a1201.rom_p", 0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) // either this or a1201.rom in kov2 is probably bad + ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) + ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) + ROM_LOAD( "a1204.rom_p", 0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) // either this or a1204.rom in kov2 is probably bad + + ROM_REGION( 0x1000000, "gfx4", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) + ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) + + ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ + ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS) + ROM_LOAD( "m1200.rom", 0x800000, 0x800000, CRC(b0d88720) SHA1(44ab137e3f8e15b7cb5697ffbd9b1143d8210c4f) ) +ROM_END + + +ROM_START( kov2p205 ) + ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ + ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) + ROM_LOAD16_WORD_SWAP( "u8-27322.rom", 0x100000, 0x400000, CRC(3a2cc0de) SHA1(d7511478b34bfb03b2fb5b8268b60502d05b9414) ) + + /* CPU2 = Z80, romless, code uploaded by 68k */ + + ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ + /* not correct for this set, needs dumping from internal rom */ + //ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, BAD_DUMP CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) // NOT for this version, works with a hack + ROM_LOAD( "kov2p205.asic", 0x000000, 0x04000, NO_DUMP ) + ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */ ROM_LOAD( "v200-16.rom", 0x000000, 0x200000, CRC(16a0c11f) SHA1(ce449cef76ebd5657d49b57951e2eb0f132e203e) ) @@ -3522,6 +3593,43 @@ ROM_START( martmast ) ROM_LOAD( "m1001.u7", 0xc00000, 0x400000, CRC(662d2d48) SHA1(2fcc3099d9c04456cae3b13035fb28eaf709e7d8) ) ROM_END +ROM_START( martmasc ) + ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ + ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) + ROM_LOAD16_WORD_SWAP( "v104_32m.u9", 0x100000, 0x400000, CRC(cfd9dff4) SHA1(328eaf6ac49a73265ee4e0f992b1b1312f49877b) ) + + /* CPU2 = Z80, romless, code uploaded by 68k */ + + ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ + ROM_LOAD( "martial_masters_v101_cn.asic", 0x000000, 0x04000, BAD_DUMP CRC(b3e25b7d) SHA1(6147d7ee2e11636521df1bb96ed5da8ad21b2a57) ) // not verified, could be bad + + ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */ + ROM_LOAD( "v102_16m.u10", 0x000000, 0x200000, CRC(18b745e6) SHA1(7bcb58dd3a2d6072f492cf0dd7181cb061c1f49d) ) + + ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ + ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS) + ROM_LOAD( "t1000.u3", 0x400000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) ) + + ROM_REGION( 0xc00000/5*8, "gfx2", ROMREGION_DISPOSE | ROMREGION_ERASEFF ) /* Region for 32x32 BG Tiles */ + /* 32x32 Tile Data is put here for easier Decoding */ + + ROM_REGION( 0x2800000, "gfx3", 0 ) /* Sprite Colour Data */ + ROM_LOAD( "a1000.u3", 0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) ) + ROM_LOAD( "a1001.u4", 0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) ) + ROM_LOAD( "a1002.u6", 0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) ) + ROM_LOAD( "a1003.u8", 0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) ) + ROM_LOAD( "a1004.u10", 0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) ) + + ROM_REGION( 0x1000000, "gfx4", 0 ) /* Sprite Masks + Colour Indexes */ + ROM_LOAD( "b1000.u9", 0x0000000, 0x0800000, CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) ) + ROM_LOAD( "b1001.u11", 0x0800000, 0x0800000, CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) ) + + ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ + ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS) + ROM_LOAD( "m1000.u5", 0x400000, 0x800000, CRC(ed407ae8) SHA1(a6e9c09b39c13e8fb7fbc89fa9f823cbeb66e901) ) + ROM_LOAD( "m1001.u7", 0xc00000, 0x400000, CRC(662d2d48) SHA1(2fcc3099d9c04456cae3b13035fb28eaf709e7d8) ) +ROM_END + /* Demon Front @@ -3684,15 +3792,21 @@ GAME( 1997, orld105k, orlegend, pgm, orld105k, orlegend, ROT0, "IGS", "Ori GAME( 1997, drgw2c, drgw2, drgw2, pgm, drgw2c, ROT0, "IGS", "Zhong Guo Long II (ver. 100C, China)", GAME_IMPERFECT_SOUND ) GAME( 1999, kov, pgm, pgm, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 117)", GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */ GAME( 1999, kov115, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 115)", GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */ -GAME( 1999, kovj, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 100, Japanese Board)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */ +GAME( 1999, kovj, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 100, Japanese Board)", GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */ +GAME( 1999, kovplus, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour Plus / Sangoku Senki Plus (ver. 119)", GAME_IMPERFECT_SOUND ) +GAME( 1999, kovplusa, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour Plus / Sangoku Senki Plus (alt ver. 119)", GAME_IMPERFECT_SOUND ) GAME( 1999, photoy2k, pgm, pgm, photoy2k, djlzz, ROT0, "IGS", "Photo Y2K", GAME_IMPERFECT_SOUND ) /* region provided by protection device */ -GAME( 1999, raf102j, photoy2k, pgm, photoy2k, djlzz, ROT0, "IGS", "Real and Fake / Photo Y2K (ver. 102, Japan Board)", GAME_IMPERFECT_SOUND ) /* region provided by protection device */ +GAME( 1999, raf102j, photoy2k, pgm, photoy2k, djlzz, ROT0, "IGS", "Real and Fake / Photo Y2K (ver. 102, Japanese Board)", GAME_IMPERFECT_SOUND ) /* region provided by protection device */ +GAME( 2000, kov2, pgm, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 (ver. 100)", GAME_IMPERFECT_SOUND ) +GAME( 2000, kov2106, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 (ver. 106)", GAME_IMPERFECT_SOUND ) +GAME( 2000, kov2p, kov2, kov2, sango, kov2p, ROT0, "IGS", "Knights of Valour 2 Plus - Nine Dragons (ver. M204XX)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_SOUND ) +GAME( 2000, kov2p205, kov2, kov2, sango, kov2p, ROT0, "IGS", "Knights of Valour 2 Plus - Nine Dragons (ver. M205XX)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_SOUND ) +GAME( 2001, martmast, pgm, kov2, sango, martmast, ROT0, "IGS", "Martial Masters (ver. 102)", GAME_IMPERFECT_SOUND ) +GAME( 2001, martmasc, martmast, kov2, sango, martmast, ROT0, "IGS", "Martial Masters (ver. 101, Chinese Board)", GAME_IMPERFECT_SOUND ) /* Playable but maybe imperfect protection emulation */ GAME( 1997, drgw2, pgm, drgw2, pgm, drgw2, ROT0, "IGS", "Dragon World II (ver. 110X, Export)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) GAME( 1997, drgw2j, drgw2, drgw2, pgm, drgw2j, ROT0, "IGS", "Chuugokuryuu II (ver. 100J, Japan)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 1999, kovplus, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour Plus / Sangoku Senki Plus (ver. 119)", GAME_IMPERFECT_SOUND ) -GAME( 1999, kovplusa, kov, pgm, sango, kov, ROT0, "IGS", "Knights of Valour Plus / Sangoku Senki Plus (alt ver. 119)", GAME_IMPERFECT_SOUND ) GAME( 1998, killbldt, killbld, killbld,killbld, killbld, ROT0, "IGS", "The Killing Blade (Chinese Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) // it's playable, but there are some things unclear about the protection GAME( 1999, puzlstar, pgm, pgm, sango, pstar, ROT0, "IGS", "Puzzle Star", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) // not playable past first few rounds @@ -3700,18 +3814,13 @@ GAME( 1999, puzlstar, pgm, pgm, sango, pstar, ROT0, "IGS", "Puz /* not working */ GAME( 1998, drgw3, pgm, pgm, sango, dw3, ROT0, "IGS", "Dragon World 3", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) GAME( 1998, drgw3k, drgw3, pgm, sango, dw3, ROT0, "IGS", "Dragon World 3 (Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 1999, kovsh, kov, kovsh, sango, kovsh, ROT0, "IGS", "Knights of Valour Superheroes / Sangoku Senki Superheroes (ver. 322)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) - +GAME( 1999, kovsh, kov, kovsh, sango, kovsh, ROT0, "IGS", "Knights of Valour Superheroes / Sangoku Senki Superheroes (ver. 104)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) GAME( 1998, killbld, pgm, killbld,killbld, killbld, ROT0, "IGS", "The Killing Blade", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 1999, olds, pgm, olds, olds, olds, ROT0, "IGS", "Oriental Legend Super / Special (Korea 101)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 1999, olds100, olds, olds, olds, olds, ROT0, "IGS", "Oriental Legend Super / Special (100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 1999, olds100a, olds, olds, olds, olds, ROT0, "IGS", "Oriental Legend Super / Special (100 alt)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 2000, kov2, pgm, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2", GAME_IMPERFECT_SOUND ) -GAME( 2000, kov2106, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 (106)", GAME_IMPERFECT_SOUND ) -GAME( 2000, kov2p, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 Plus - Nine Dragons", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) +GAME( 1999, olds, pgm, olds, olds, olds, ROT0, "IGS", "Oriental Legend Super / Special (ver. 101, Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) +GAME( 1999, olds100, olds, olds, olds, olds, ROT0, "IGS", "Oriental Legend Super / Special (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) +GAME( 1999, olds100a, olds, olds, olds, olds, ROT0, "IGS", "Oriental Legend Super / Special (alt ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) GAME( 2001, ddp2, pgm, pgm, ddp2, ddp2, ROT270, "IGS", "Bee Storm - DoDonPachi II", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) GAME( 2001, puzzli2, pgm, pgm, sango, puzzli2, ROT0, "IGS", "Puzzli 2 Super", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 2001, martmast, pgm, kov2, sango, martmast, ROT0, "IGS", "Martial Masters", GAME_IMPERFECT_SOUND ) GAME( 2001, theglad, pgm, pgm, sango, pgm, ROT0, "IGS", "The Gladiator", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 2002, dmnfrnt, pgm, pgm, sango, pgm, ROT0, "IGS", "Demon Front (V102)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) -GAME( 2002, dmnfrnta, dmnfrnt, pgm, sango, pgm, ROT0, "IGS", "Demon Front (V105)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) +GAME( 2002, dmnfrnt, pgm, pgm, sango, pgm, ROT0, "IGS", "Demon Front (ver. 102)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) +GAME( 2002, dmnfrnta, dmnfrnt, pgm, sango, pgm, ROT0, "IGS", "Demon Front (ver. 105)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h index be29b13a5b0..e6539a76a80 100644 --- a/src/mame/includes/pgm.h +++ b/src/mame/includes/pgm.h @@ -12,6 +12,7 @@ extern size_t pgm_sprite_a_region_allocate; void pgm_kov_decrypt(running_machine *machine); void pgm_kovsh_decrypt(running_machine *machine); void pgm_kov2_decrypt(running_machine *machine); +void pgm_kov2p_decrypt(running_machine *machine); void pgm_mm_decrypt(running_machine *machine); void pgm_dw2_decrypt(running_machine *machine); void pgm_djlzz_decrypt(running_machine *machine); diff --git a/src/mame/machine/pgmcrypt.c b/src/mame/machine/pgmcrypt.c index 5afc12835e8..511868f282c 100644 --- a/src/mame/machine/pgmcrypt.c +++ b/src/mame/machine/pgmcrypt.c @@ -552,6 +552,65 @@ void pgm_kov2_decrypt(running_machine *machine) } } +static const UINT8 kov2p_tab[256] = { + 0x44, 0x47, 0xb8, 0x28, 0x03, 0xa2, 0x21, 0xbc, 0x17, 0x32, 0x4e, 0xe2, 0xdf, 0x69, 0x35, 0xc7, + 0xa2, 0x06, 0xec, 0x36, 0xd2, 0x44, 0x12, 0x6a, 0x8d, 0x51, 0x6b, 0x20, 0x69, 0x01, 0xca, 0xf0, + 0x71, 0xc4, 0x34, 0xdc, 0x6b, 0xd6, 0x42, 0x2a, 0x5d, 0xb5, 0xc7, 0x6f, 0x4f, 0xd8, 0xb3, 0xed, + 0x51, 0x9e, 0x37, 0x1e, 0xc0, 0x85, 0x2a, 0x91, 0xc6, 0x9c, 0xac, 0xf5, 0x20, 0x3b, 0x09, 0x74, + 0x24, 0xf1, 0xe0, 0x42, 0x02, 0xbe, 0x84, 0x75, 0x4a, 0x82, 0xa2, 0x17, 0xae, 0xb6, 0x24, 0x79, + 0x0a, 0x5a, 0x56, 0xcb, 0xa1, 0x2e, 0x47, 0xea, 0xa9, 0x25, 0x73, 0x79, 0x0b, 0x17, 0x9e, 0x33, + 0x64, 0xb6, 0x03, 0x7f, 0x4f, 0xc3, 0xae, 0x45, 0xe6, 0x82, 0x27, 0x01, 0x86, 0x6b, 0x50, 0x16, + 0xd3, 0x22, 0x90, 0x64, 0xfc, 0xa9, 0x31, 0x1c, 0x41, 0xd5, 0x07, 0xd3, 0xb2, 0xfe, 0x53, 0xd6, + 0x39, 0xfb, 0xe6, 0xbe, 0xda, 0x4d, 0x8a, 0x44, 0x3a, 0x9b, 0x9d, 0x56, 0x5e, 0x5f, 0xff, 0x6a, + 0xb6, 0xde, 0x2f, 0x12, 0x5a, 0x5d, 0xb0, 0xd0, 0x93, 0x92, 0xb2, 0x2c, 0x9d, 0x59, 0xee, 0x05, + 0xab, 0xa8, 0xd2, 0x25, 0x2c, 0xc5, 0xde, 0x18, 0x4d, 0xb6, 0x4e, 0x3d, 0xbf, 0xfa, 0xf9, 0x1d, + 0xba, 0x76, 0x79, 0xfc, 0x42, 0xb2, 0x8c, 0xae, 0xa9, 0x45, 0xba, 0xac, 0x55, 0x8e, 0x38, 0x67, + 0xc3, 0xa5, 0x0d, 0xdc, 0xcc, 0x91, 0x73, 0x69, 0x27, 0xbc, 0x80, 0xdf, 0x30, 0xa4, 0x05, 0xd8, + 0xe7, 0xd2, 0xb7, 0x4b, 0x3c, 0x10, 0x8c, 0x5d, 0x8a, 0xd7, 0x68, 0x7a, 0x61, 0x07, 0xf9, 0xa5, + 0x88, 0xda, 0xdf, 0x0c, 0x42, 0x1b, 0x11, 0xe0, 0xd1, 0x93, 0x7c, 0x63, 0x39, 0xc5, 0xed, 0x43, + 0x46, 0xdb, 0x30, 0x26, 0xd0, 0xdf, 0x7a, 0x86, 0x3e, 0x2e, 0x04, 0xbf, 0x49, 0x2a, 0xf9, 0x66, +}; + +void pgm_kov2p_decrypt(running_machine *machine) +{ + int i; + UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); + + int rom_size = 0x200000; + + for(i=0; i> 1) & 0xff] << 8; + + src[i] = x; + } +} + static const UINT8 puzzli2_tab[256] = { 0xb7, 0x66, 0xa3, 0xc0, 0x51, 0x55, 0x6d, 0x63, 0x86, 0x60, 0x64, 0x6c, 0x67, 0x18, 0x0b, 0x05, 0x62, 0xff, 0xe0, 0x1e, 0x30, 0x21, 0x2e, 0x40, 0x41, 0xb9, 0x60, 0x38, 0xd1, 0x24, 0x7e, 0x36, diff --git a/src/mame/mamedriv.c b/src/mame/mamedriv.c index c1e71e94562..0a22f5711e9 100644 --- a/src/mame/mamedriv.c +++ b/src/mame/mamedriv.c @@ -7681,9 +7681,11 @@ Other Sun games DRIVER( kov2 ) /* (c) 2000 */ DRIVER( kov2106 ) /* (c) 2000 */ DRIVER( kov2p ) /* (c) 2000 */ + DRIVER( kov2p205 ) /* (c) 2000 */ DRIVER( ddp2 ) /* (c) 2001 */ DRIVER( puzzli2 ) /* (c) 2001 */ DRIVER( martmast ) /* (c) 2001 */ + DRIVER( martmasc ) /* (c) 2001 */ DRIVER( theglad ) /* (c) 2001 */ DRIVER( dmnfrnt ) /* (c) 2002 */ DRIVER( dmnfrnta ) /* (c) 2002 */ diff --git a/src/mame/video/pgm.c b/src/mame/video/pgm.c index 8a3be1ba220..b65c53a928e 100644 --- a/src/mame/video/pgm.c +++ b/src/mame/video/pgm.c @@ -7,6 +7,7 @@ static tilemap *pgm_tx_tilemap, *pgm_bg_tilemap; static UINT16 *pgm_spritebufferram; // buffered spriteram static UINT16 *sprite_temp_render; +static bitmap_t *tmppgmbitmap; /* Sprites - These are a pain! */ @@ -53,8 +54,8 @@ static void pgm_prepare_sprite(running_machine *machine, int wide, int high,int } - -static void draw_sprite_line(int wide, UINT16* dest, int xzoom, int xgrow, int yoffset, int flip, int xpos) +// in the dest bitmap 0x10000 is used to mark 'used pixel' and 0x8000 is used to mark 'high priority' +static void draw_sprite_line(int wide, UINT32* dest, int xzoom, int xgrow, int yoffset, int flip, int xpos, int pri) { int xcnt,xcntdraw; int xzoombit; @@ -77,7 +78,11 @@ static void draw_sprite_line(int wide, UINT16* dest, int xzoom, int xgrow, int y xdrawpos = xpos + xcntdraw; if (!(srcdat&0x8000)) { - if ((xdrawpos >= 0) && (xdrawpos < 448)) dest[xdrawpos] = srcdat; + if ((xdrawpos >= 0) && (xdrawpos < 448)) + { + if (pri) dest[xdrawpos] = srcdat | 0x8000 | 0x10000; + else dest[xdrawpos] = srcdat | 0x10000; + } } xcntdraw++; @@ -85,7 +90,11 @@ static void draw_sprite_line(int wide, UINT16* dest, int xzoom, int xgrow, int y if (!(srcdat&0x8000)) { - if ((xdrawpos >= 0) && (xdrawpos < 448)) dest[xdrawpos] = srcdat; + if ((xdrawpos >= 0) && (xdrawpos < 448)) + { + if (pri) dest[xdrawpos] = srcdat | 0x8000 | 0x10000; + else dest[xdrawpos] = srcdat | 0x10000; + } } xcntdraw++; } @@ -98,7 +107,11 @@ static void draw_sprite_line(int wide, UINT16* dest, int xzoom, int xgrow, int y xdrawpos = xpos + xcntdraw; if (!(srcdat&0x8000)) { - if ((xdrawpos >= 0) && (xdrawpos < 448)) dest[xdrawpos] = srcdat; + if ((xdrawpos >= 0) && (xdrawpos < 448)) + { + if (pri) dest[xdrawpos] = srcdat | 0x8000 | 0x10000; + else dest[xdrawpos] = srcdat | 0x10000; + } } xcntdraw++; } @@ -109,11 +122,11 @@ static void draw_sprite_line(int wide, UINT16* dest, int xzoom, int xgrow, int y } } /* this just loops over our decoded bitmap and puts it on the screen */ -static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, bitmap_t* bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow ) +static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, bitmap_t* bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow, int pri ) { int ycnt; int ydrawpos; - UINT16 *dest; + UINT32 *dest; int yoffset; int ycntdraw; int yzoombit; @@ -135,8 +148,8 @@ static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, else yoffset = ( (high-ycnt-1)*(wide*16)); if ((ydrawpos >= 0) && (ydrawpos < 224)) { - dest = BITMAP_ADDR16(bitmap, ydrawpos, 0); - draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos); + dest = BITMAP_ADDR32(bitmap, ydrawpos, 0); + draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos, pri); } ycntdraw++; @@ -145,8 +158,8 @@ static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, else yoffset = ( (high-ycnt-1)*(wide*16)); if ((ydrawpos >= 0) && (ydrawpos < 224)) { - dest = BITMAP_ADDR16(bitmap, ydrawpos, 0); - draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos); + dest = BITMAP_ADDR32(bitmap, ydrawpos, 0); + draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos, pri); } ycntdraw++; @@ -165,8 +178,8 @@ static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, else yoffset = ( (high-ycnt-1)*(wide*16)); if ((ydrawpos >= 0) && (ydrawpos < 224)) { - dest = BITMAP_ADDR16(bitmap, ydrawpos, 0); - draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos); + dest = BITMAP_ADDR32(bitmap, ydrawpos, 0); + draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos, pri); } ycntdraw++; @@ -180,7 +193,7 @@ static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, static UINT16 *pgm_sprite_source; -static void draw_sprites(running_machine *machine, int priority, bitmap_t* bitmap) +static void draw_sprites(running_machine *machine, bitmap_t* spritebitmap) { /* ZZZZ Zxxx xxxx xxxx zzzz z-yy yyyy yyyy @@ -232,9 +245,9 @@ static void draw_sprites(running_machine *machine, int priority, bitmap_t* bitma if (high == 0) break; /* is this right? */ - if ((priority == 1) && (pri == 0)) break; + //if ((priority == 1) && (pri == 0)) break; - draw_sprite_new_zoomed(machine, wide, high, xpos, ypos, palt, boff, flip, bitmap, xzoom,xgrow, yzoom,ygrow); + draw_sprite_new_zoomed(machine, wide, high, xpos, ypos, palt, boff, flip, spritebitmap, xzoom,xgrow, yzoom,ygrow, pri); pgm_sprite_source += 5; } @@ -304,6 +317,8 @@ static TILE_GET_INFO( get_pgm_bg_tilemap_tile_info ) VIDEO_START( pgm ) { + int i; + pgm_tx_tilemap= tilemap_create(machine, get_pgm_tx_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32); tilemap_set_transparent_pen(pgm_tx_tilemap,15); @@ -311,6 +326,11 @@ VIDEO_START( pgm ) tilemap_set_transparent_pen(pgm_bg_tilemap,31); tilemap_set_scroll_rows(pgm_bg_tilemap,64*32); + tmppgmbitmap = auto_bitmap_alloc(448,224,BITMAP_FORMAT_RGB32); + + for (i=0; i < 0x1200/2; i++) + palette_set_color(machine, i, MAKE_RGB(0, 0, 0)); + pgm_spritebufferram = auto_malloc (0xa00); /* we render each sprite to a bitmap then copy the bitmap to screen bitmap with zooming */ @@ -323,19 +343,54 @@ VIDEO_UPDATE( pgm ) int y; bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); + bitmap_fill(tmppgmbitmap, cliprect, 0x00000000); + pgm_sprite_source = pgm_spritebufferram; - draw_sprites(screen->machine, 1, bitmap); + draw_sprites(screen->machine, tmppgmbitmap); tilemap_set_scrolly(pgm_bg_tilemap,0, pgm_videoregs[0x2000/2]); for (y = 0; y < 224; y++) tilemap_set_scrollx(pgm_bg_tilemap,(y+pgm_videoregs[0x2000/2])&0x7ff, pgm_videoregs[0x3000/2]+pgm_rowscrollram[y]); + { + int y,x; + + for (y=0;y<224;y++) + { + UINT32* src = BITMAP_ADDR32(tmppgmbitmap, y, 0); + UINT16* dst = BITMAP_ADDR16(bitmap, y, 0); + + for (x=0;x<448;x++) + { + if (src[x]&0x10000) + if ((src[x]&0x8000)==0x8000) + dst[x] = src[x]&0x7fff; + } + } + } + + tilemap_draw(bitmap,cliprect,pgm_bg_tilemap,0,0); - draw_sprites(screen->machine, 0, bitmap); + { + int y,x; + for (y=0;y<224;y++) + { + UINT32* src = BITMAP_ADDR32(tmppgmbitmap, y, 0); + UINT16* dst = BITMAP_ADDR16(bitmap, y, 0); + + for (x=0;x<448;x++) + { + if (src[x]&0x10000) + if ((src[x]&0x8000)==0x0000) + dst[x] = src[x]; + } + } + } + tilemap_set_scrolly(pgm_tx_tilemap,0, pgm_videoregs[0x5000/2]); tilemap_set_scrollx(pgm_tx_tilemap,0, pgm_videoregs[0x6000/2]); // Check tilemap_draw(bitmap,cliprect,pgm_tx_tilemap,0,0);