diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c index dec15f5c193..a4b79b74cb3 100644 --- a/src/mame/drivers/dkong.c +++ b/src/mame/drivers/dkong.c @@ -296,6 +296,17 @@ 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 "emu.h" @@ -306,6 +317,7 @@ Donkey Kong Junior Notes #include "machine/8257dma.h" #include "machine/z80dma.h" #include "machine/latch8.h" +#include "machine/eeprom.h" /************************************* * @@ -1570,6 +1582,61 @@ static GFXDECODE_START( pestplce ) GFXDECODE_END +/************************************* + * + * 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_DEVICE_HANDLER( braze_eeprom_r ) +{ + return eeprom_read_bit(device); +} + +static WRITE8_HANDLER( braze_a15_w ) +{ + memory_set_bank(space->machine, "bank1", data & 0x01); + memory_set_bank(space->machine, "bank2", data & 0x01); +} + +static WRITE8_DEVICE_HANDLER( braze_eeprom_w ) +{ + eeprom_write_bit(device, data & 0x01); + eeprom_set_cs_line(device, data & 0x04 ? CLEAR_LINE : ASSERT_LINE); + eeprom_set_clock_line(device, data & 0x02 ? ASSERT_LINE : CLEAR_LINE); +} + +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; + } +} + /************************************* * * Machine driver @@ -1644,6 +1711,12 @@ static MACHINE_DRIVER_START( dkong2b ) MACHINE_DRIVER_END +static MACHINE_DRIVER_START( braze ) + MDRV_IMPORT_FROM(dkong2b) + + MDRV_EEPROM_ADD("eeprom", braze_eeprom_intf) +MACHINE_DRIVER_END + static MACHINE_DRIVER_START( dkong3 ) /* driver data */ @@ -2028,6 +2101,70 @@ ROM_START( dkongf ) /* Donkey Kong Foundry (hack) from Jeff's Romhack */ ROM_LOAD( "v-5e.bpr", 0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */ ROM_END +ROM_START( dkongx ) + ROM_REGION( 0x10000, "maincpu", 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) SHA1(c058add0f146d577e3df0ba60828fe1734e78d01) ) + + ROM_REGION( 0x1800, "soundcpu", 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", 0 ) + 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", 0 ) + 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 + +ROM_START( dkongx11 ) + ROM_REGION( 0x10000, "maincpu", 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( "d2k11.bin", 0x00000, 0x10000, CRC(2048fc42) SHA1(e427a09ed8e792ee8ce01cd0b07c6a0d5a7c5536) ) + + ROM_REGION( 0x1800, "soundcpu", 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", 0 ) + 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", 0 ) + 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 + ROM_START( dkongjr ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "dkj.5b", 0x0000, 0x1000, CRC(dea28158) SHA1(08baf84ae6f9b40a2c743fe1d8c158c74a40e95a) ) @@ -2944,6 +3081,31 @@ static DRIVER_INIT( strtheat ) memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7c80, 0x7c80, 0, 0, strtheat_inputport_1_r); } + +static DRIVER_INIT( dkongx ) +{ + UINT8 *decrypted; + address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); + running_device *eeprom = machine->device("eeprom"); + + decrypted = auto_alloc_array(machine, UINT8, 0x10000); + + memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, "bank1" ); + memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, "bank2" ); + + memory_install_write8_handler(space, 0xe000, 0xe000, 0, 0, braze_a15_w); + + memory_install_read8_device_handler(space, eeprom, 0xc800, 0xc800, 0, 0, braze_eeprom_r); + memory_install_write8_device_handler(space, eeprom, 0xc800, 0xc800, 0, 0, braze_eeprom_w); + + braze_decrypt_rom(machine, decrypted); + + memory_configure_bank(machine,"bank1", 0, 2, &decrypted[0], 0x8000); + memory_set_bank(machine,"bank1", 0); + memory_configure_bank(machine,"bank2", 0, 2, &decrypted[0], 0x8000); + memory_set_bank(machine,"bank2", 0); +} + /************************************* * * Game drivers @@ -2957,8 +3119,10 @@ GAME( 1981, dkong, 0, dkong2b, dkong, 0, ROT90, "Nintendo o GAME( 1981, dkongo, dkong, dkong2b, dkong, 0, ROT90, "Nintendo", "Donkey Kong (US set 2)", GAME_SUPPORTS_SAVE ) GAME( 1981, dkongj, dkong, dkong2b, dkong, 0, ROT90, "Nintendo", "Donkey Kong (Japan set 1)", GAME_SUPPORTS_SAVE ) GAME( 1981, dkongjo, dkong, dkong2b, dkong, 0, ROT90, "Nintendo", "Donkey Kong (Japan set 2)", GAME_SUPPORTS_SAVE ) -GAME( 1981, dkongjo1, dkong, dkong2b, dkong, 0, ROT90, "Nintendo", "Donkey Kong (Japan set 3) (bad dump?)", GAME_SUPPORTS_SAVE ) +GAME( 1981, dkongjo1, dkong, dkong2b, dkong, 0, ROT90, "Nintendo", "Donkey Kong (Japan set 3)", GAME_SUPPORTS_SAVE ) GAME( 2004, dkongf, dkong, dkong2b, dkongf, 0, ROT90, "hack", "Donkey Kong Foundry (hack)", GAME_SUPPORTS_SAVE ) /* from Jeff's Romhack */ +GAME( 2006, dkongx, dkong, braze, dkong, dkongx, ROT90, "hack", "Donkey Kong II - Jumpman Returns (V1.2) (hack)", GAME_SUPPORTS_SAVE ) +GAME( 2006, dkongx11, dkong, braze, dkong, dkongx, ROT90, "hack", "Donkey Kong II - Jumpman Returns (V1.1) (hack)", GAME_SUPPORTS_SAVE ) GAME( 1982, dkongjr, 0, dkongjr, dkongjr, 0, ROT90, "Nintendo of America", "Donkey Kong Junior (US)", GAME_SUPPORTS_SAVE ) GAME( 1982, dkongjrj, dkongjr, dkongjr, dkongjr, 0, ROT90, "Nintendo", "Donkey Kong Jr. (Japan)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/mamedriv.c b/src/mame/mamedriv.c index 71946c7d793..5b1e8e3b361 100644 --- a/src/mame/mamedriv.c +++ b/src/mame/mamedriv.c @@ -1069,6 +1069,8 @@ const game_driver * const drivers[] = DRIVER( dkongjo ) /* (c) 1981 Nintendo */ DRIVER( dkongjo1 ) /* (c) 1981 Nintendo */ DRIVER( dkongf ) /* hack from Jeff's Romhack */ + DRIVER( dkongx ) /* hack */ + DRIVER( dkongx11 ) /* hack */ DRIVER( dkongjr ) /* (c) 1982 Nintendo of America */ DRIVER( dkongjrj ) /* (c) 1982 Nintendo */ DRIVER( dkongjnrj ) /* (c) 1982 Nintendo */