From 493ccba85f9ef3946263dbff77999d2f161a8558 Mon Sep 17 00:00:00 2001 From: Couriersud Date: Sat, 25 Oct 2008 22:46:30 +0000 Subject: [PATCH] New clone: D2K Jumpman returns - emulates Braze Technologies addon board - eeprom hooked up - implemented bank switching I am still unsure about whether this should be added or not. Interestingly, D2K shows a "(C) 1981 Nintendo" copyright message. Still, it is actively marketed. Putting this up for discussion again. --- src/mame/drivers/dkong.c | 150 ++++++++++++++++++++++++++++++++++++++- src/mame/mamedriv.c | 1 + 2 files changed, 149 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c index 4c1bd180061..7519f27fae6 100644 --- a/src/mame/drivers/dkong.c +++ b/src/mame/drivers/dkong.c @@ -7,8 +7,6 @@ TODO: - Shooting Gallery: Shootgal.txt mentions speech pcb, mikesarcade.com dk conversion - Clarify - 8ballact: read 1507 no mapped -- implement 74LS259 (8bit addressable latches), - 74LS175 (QUAD D FlipFlop), 74LS373 (Octal transparent latch) Done: - dkong3 dma (Z80 dma) @@ -296,6 +294,16 @@ Donkey Kong Junior Notes 2764.5Cp DJR1-C-5C p 2764 5C(CPU) F4FE ------------------------------------------------ +D2K Jumpman returns Notes +========================= + +This is a DKong/Hack combo using a Braze Technologies High Score Save pcb. +This pcb will be placed in the cpu socket and the Z80 together with an +additional 64K rom, a 74LS245, an eeprom and a pal/gal. It looks like the +"encryption" was a conincidence resulting from an easy pcb layout. +The pal is also used to switch A15 on and off. This is done in locations +6800 and E800. + ***************************************************************************/ #include "driver.h" @@ -305,6 +313,8 @@ Donkey Kong Junior Notes #include "machine/8257dma.h" #include "machine/z80dma.h" #include "machine/latch8.h" +#include "machine/eeprom.h" + /************************************* * @@ -487,6 +497,7 @@ static MACHINE_RESET( drakton ) } + /************************************* * * DMA handling @@ -750,6 +761,52 @@ static READ8_HANDLER( strtheat_inputport_1_r ) } } +/************************************* + * + * Braze Tech Addon boards + * + *************************************/ + +static const eeprom_interface braze_eeprom_intf = +{ + 7, /* address bits */ + 8, /* data bits */ + "*110", /* read command */ + "*101", /* write command */ + 0, /* erase command */ + "*10000xxxxx", /* lock command */ + "*10011xxxxx", /* unlock command */ +}; + +static READ8_HANDLER( braze_eeprom_r ) +{ + return eeprom_read_bit(); +} + +static WRITE8_HANDLER( braze_a15_w ) +{ + memory_set_bank(1, data & 0x01); + memory_set_bank(2, data & 0x01); +} + +static WRITE8_HANDLER( braze_eeprom_w ) +{ + eeprom_write_bit(data & 0x01); + eeprom_set_cs_line(data & 0x04 ? CLEAR_LINE : ASSERT_LINE); + eeprom_set_clock_line(data & 0x02 ? ASSERT_LINE : CLEAR_LINE); +} + +static NVRAM_HANDLER( braze_eeprom ) +{ + if (read_or_write) + eeprom_save(file); + else + { + eeprom_init(&braze_eeprom_intf); + if (file) + eeprom_load(file); + } +} /************************************* * @@ -1641,6 +1698,16 @@ static MACHINE_DRIVER_START( dkong2b ) MACHINE_DRIVER_END + +static MACHINE_DRIVER_START( braze ) + + MDRV_IMPORT_FROM(dkong2b) + + MDRV_CPU_MODIFY("main") + MDRV_NVRAM_HANDLER(braze_eeprom) + +MACHINE_DRIVER_END + static MACHINE_DRIVER_START( dkong3 ) /* driver data */ @@ -2814,6 +2881,40 @@ ROM_START( shootgal ) ROM_LOAD( "82s147.prm", 0x0000, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) ) /* no dump - taken from hunchbkd */ ROM_END +ROM_START( dkongx ) + ROM_REGION( 0x10000, "main", 0 ) + ROM_LOAD( "c_5et_g.bin", 0x0000, 0x1000, CRC(ba70b88b) SHA1(d76ebecfea1af098d843ee7e578e480cd658ac1a) ) + ROM_LOAD( "c_5ct_g.bin", 0x1000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) ) + ROM_LOAD( "c_5bt_g.bin", 0x2000, 0x1000, CRC(1c97d324) SHA1(c7966261f3a1d3296927e0b6ee1c58039fc53c1f) ) + ROM_LOAD( "c_5at_g.bin", 0x3000, 0x1000, CRC(b9005ac0) SHA1(3fe3599f6fa7c496f782053ddf7bacb453d197c4) ) + /* space for diagnostic ROM */ + + ROM_REGION( 0x10000, "braze", 0 ) + ROM_LOAD( "27512.bin", 0x0000, 0x10000, CRC(6e95ca0d) ) + //ROM_LOAD( "27512.bin", 0x4000, 0xc000, CRC(6e95ca0d) ) + //ROM_CONTINUE(0x0000,0x4000) + + ROM_REGION( 0x1800, "sound", 0 ) /* sound */ + ROM_LOAD( "s_3i_b.bin", 0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) ) + ROM_RELOAD( 0x0800, 0x0800 ) + ROM_LOAD( "s_3j_b.bin", 0x1000, 0x0800, CRC(4743fe92) SHA1(6c82b57637c0212a580591397e6a5a1718f19fd2) ) + + ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) + ROM_LOAD( "v_5h_b.bin", 0x0000, 0x0800, CRC(12c8c95d) SHA1(a57ff5a231c45252a63b354137c920a1379b70a3) ) + ROM_LOAD( "v_3pt.bin", 0x0800, 0x0800, CRC(15e9c5e9) SHA1(976eb1e18c74018193a35aa86cff482ebfc5cc4e) ) + + ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE ) + ROM_LOAD( "l_4m_b.bin", 0x0000, 0x0800, CRC(59f8054d) SHA1(793dba9bf5a5fe76328acdfb90815c243d2a65f1) ) + ROM_LOAD( "l_4n_b.bin", 0x0800, 0x0800, CRC(672e4714) SHA1(92e5d379f4838ac1fa44d448ce7d142dae42102f) ) + ROM_LOAD( "l_4r_b.bin", 0x1000, 0x0800, CRC(feaa59ee) SHA1(ecf95db5a20098804fc8bd59232c66e2e0ed3db4) ) + ROM_LOAD( "l_4s_b.bin", 0x1800, 0x0800, CRC(20f2ef7e) SHA1(3bc482a38bf579033f50082748ee95205b0f673d) ) + + ROM_REGION( 0x0300, "proms", 0 ) + ROM_LOAD( "c-2k.bpr", 0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */ + ROM_LOAD( "c-2j.bpr", 0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */ + ROM_LOAD( "v-5e.bpr", 0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */ +ROM_END + /************************************* * * Decryption code @@ -2843,6 +2944,26 @@ static void drakton_decrypt_rom(running_machine *machine, UINT8 mod, int offs, i } } +static void braze_decrypt_rom(running_machine *machine, UINT8 *dest) +{ + UINT8 oldbyte,newbyte; + UINT8 *ROM; + UINT32 mem; + UINT32 newmem; + + ROM = memory_region(machine, "braze"); + + for (mem=0;mem<0x10000;mem++) + { + oldbyte = ROM[mem]; + + newmem = ((BITSWAP8((mem >> 8),7,2,3,1,0,6,4,5))<<8) | (mem & 0xff); + newbyte = BITSWAP8(oldbyte, 1,4,5,7,6,0,3,2); + + dest[newmem] = newbyte; + } +} + /************************************* * * Driver Init Code @@ -2914,6 +3035,28 @@ static DRIVER_INIT( strtheat ) memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7c80, 0x7c80, 0, 0, strtheat_inputport_1_r); } +static DRIVER_INIT( dkongx ) +{ + UINT8 *decrypted; + + decrypted = auto_malloc(0x10000); + + memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK1 ); + memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_BANK2 ); + + memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xE000, 0xE000, 0, 0, braze_a15_w ); + + memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xC800, 0, 0, braze_eeprom_r ); + memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xC800, 0, 0, braze_eeprom_w ); + + braze_decrypt_rom(machine, decrypted); + + memory_configure_bank(1, 0, 2, &decrypted[0], 0x8000); + memory_set_bank(1, 0); + memory_configure_bank(2, 0, 2, &decrypted[0], 0x8000); + memory_set_bank(2, 0); +} + /************************************* * * Game drivers @@ -2958,3 +3101,6 @@ GAME( 1985, spcfrcii, 0, spclforc, spclforc, 0, ROT90, "Senko Industries GAME( 1984, drakton, 0, drakton, drakton, drakton, ROT90, "Epos Corporation", "Drakton (DK conversion)", GAME_SUPPORTS_SAVE ) GAME( 1984, drktnjr, drakton, drktnjr, drakton, drakton, ROT90, "Epos Corporation", "Drakton (DKJr conversion)", GAME_SUPPORTS_SAVE ) GAME( 1985, strtheat, 0, strtheat, strtheat, strtheat, ROT90, "Epos Corporation", "Street Heat - Cardinal Amusements", GAME_SUPPORTS_SAVE ) + +/* Hacks */ +GAME( 200?, dkongx, dkong, braze, dkong, dkongx, ROT90, "Jeff's Romhack", "D2K Jumpman returns (Hack)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/mamedriv.c b/src/mame/mamedriv.c index 02434b7cb3c..13498ac4086 100644 --- a/src/mame/mamedriv.c +++ b/src/mame/mamedriv.c @@ -968,6 +968,7 @@ const game_driver * const drivers[] = DRIVER( herbiedk ) /* (c) 1984 CVS */ DRIVER( herodk ) /* (c) 1984 Seatongrove + Crown license */ DRIVER( herodku ) /* (c) 1984 Seatongrove + Crown license */ + DRIVER( dkongx ) /* 200? Jeff's Romhack */ DRIVER( skyskipr ) /* (c) 1981 */ DRIVER( popeye ) /* (c) 1982 */ DRIVER( popeyeu ) /* (c) 1982 */