Skip to content

Commit

Permalink
Merge pull request #1673 from grant2258/dkremix
Browse files Browse the repository at this point in the history
use banking for braze
  • Loading branch information
arcadez2003 committed Jan 24, 2024
2 parents f1b1412 + b0bb203 commit aed76b2
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 40 deletions.
1 change: 1 addition & 0 deletions src/driver.c
Expand Up @@ -813,6 +813,7 @@ const struct GameDriver *test_drivers[] =
DRIVER( dkongjo1 ) /* (c) 1981 Nintendo */
DRIVER( dkongx ) /* (c) 2008 Bootleg */
DRIVER( dkremix ) /* 2015 Bootleg */
DRIVER( dkchrmx )
DRIVER( dkongjr ) /* (c) 1982 Nintendo of America */
DRIVER( dkongjrj ) /* (c) 1982 Nintendo */
DRIVER( dkngjnrj ) /* (c) 1982 Nintendo */
Expand Down
106 changes: 66 additions & 40 deletions src/drivers/dkong.c
Expand Up @@ -148,7 +148,7 @@ I/O ports
*
*************************************/

static int banks = 0;
static int banks = 99;

static struct EEPROM_interface braze_eeprom_intf =
{
Expand Down Expand Up @@ -180,12 +180,21 @@ static READ_HANDLER( braze_eeprom_r )

static WRITE_HANDLER( braze_a15_w )
{

if (banks != (data & 1)) {

banks = data & 1;
memcpy (memory_region(REGION_CPU1) + 0x0000, memory_region(REGION_USER1) + 0x10000 + (0x8000 * banks), 0x06000); /* ?*/
memcpy (memory_region(REGION_CPU1) + 0x8000, memory_region(REGION_USER1) + 0x10000 + (0x8000 * banks), 0x08000); /* ?*/
}
//printf("banks:%d\n",banks);

if(banks)
{
cpu_setbank(1, memory_region(REGION_USER1) + 0x18000);
cpu_setbank(2, memory_region(REGION_USER1) + 0x18000);
}
else
{
cpu_setbank(1, memory_region(REGION_USER1) + 0x10000);
cpu_setbank(2, memory_region(REGION_USER1) + 0x10000);
}

}

static WRITE_HANDLER( braze_eeprom_w )
Expand Down Expand Up @@ -307,16 +316,17 @@ static MEMORY_READ_START( readmem )
MEMORY_END

static MEMORY_READ_START( dkong2_readmem )
{ 0x0000, 0x5fff, MRA_ROM }, /* DK: 0000-3fff */
{ 0x0000, 0x5fff, MRA_BANK1 }, /* DK: 0000-3fff */
{ 0x6000, 0x6fff, MRA_RAM }, /* including sprites RAM */
{ 0x7400, 0x77ff, MRA_RAM }, /* video RAM */
{ 0x7c00, 0x7c00, input_port_0_r }, /* IN0 */
{ 0x7c80, 0x7c80, input_port_1_r }, /* IN1 */
{ 0x7d00, 0x7d00, dkong_in2_r }, /* IN2/DSW2 */
{ 0x7d80, 0x7d80, input_port_3_r }, /* DSW1 */
{ 0x8000, 0xffff, MRA_BANK2 }, /* DK3 and bootleg DKjr only */
{ 0xc800, 0xc800, braze_eeprom_r },
{ 0x8000, 0x9fff, MRA_ROM }, /* DK3 and bootleg DKjr only */
{ 0xb000, 0xbfff, MRA_ROM }, /* Pest Place only */


MEMORY_END

static MEMORY_READ_START( dkong3_readmem )
Expand Down Expand Up @@ -2912,20 +2922,19 @@ ROM_END

/* Braze Technologies bootleg hardware */
ROM_START( dkongx )
ROM_REGION( 0x20000, REGION_CPU1, 0 )
ROM_LOAD( "c_5et_g.bin", 0x10000, 0x1000, CRC(ba70b88b) SHA1(d76ebecfea1af098d843ee7e578e480cd658ac1a) )
ROM_LOAD( "c_5ct_g.bin", 0x11000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) )
ROM_LOAD( "c_5bt_g.bin", 0x12000, 0x1000, CRC(1c97d324) SHA1(c7966261f3a1d3296927e0b6ee1c58039fc53c1f) )
ROM_LOAD( "c_5at_g.bin", 0x13000, 0x1000, CRC(b9005ac0) SHA1(3fe3599f6fa7c496f782053ddf7bacb453d197c4) )
ROM_REGION( 0x10000, REGION_CPU1, 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( 0x20000, REGION_USER1, 0 )
ROM_LOAD( "d2k12.bin", 0x0000, 0x10000, CRC(6e95ca0d) SHA1(c058add0f146d577e3df0ba60828fe1734e78d01) ) /* Version 1.2 */

ROM_REGION( 0x1800, REGION_CPU2, 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_LOAD( "s_3j_b.bin", 0x0800, 0x0800, CRC(4743fe92) SHA1(6c82b57637c0212a580591397e6a5a1718f19fd2) )

ROM_REGION( 0x1000, REGION_GFX1, 0 )
ROM_LOAD( "v_5h_b.bin", 0x0000, 0x0800, CRC(12c8c95d) SHA1(a57ff5a231c45252a63b354137c920a1379b70a3) )
Expand All @@ -2944,31 +2953,19 @@ ROM_START( dkongx )
ROM_END

ROM_START( dkremix )
/*
ROM_REGION( 0x20000, REGION_CPU1, 0 )
ROM_LOAD( "c_5et_g.bin", 0x10000, 0x1000, CRC(ba70b88b) SHA1(d76ebecfea1af098d843ee7e578e480cd658ac1a) )
ROM_LOAD( "c_5ct_g.bin", 0x11000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) )
ROM_LOAD( "c_5bt_g.bin", 0x12000, 0x1000, CRC(1c97d324) SHA1(c7966261f3a1d3296927e0b6ee1c58039fc53c1f) )
ROM_LOAD( "c_5at_g.bin", 0x13000, 0x1000, CRC(b9005ac0) SHA1(3fe3599f6fa7c496f782053ddf7bacb453d197c4) )
ROM_REGION( 0x10000, REGION_CPU1, 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( 0x20000, REGION_USER1, 0 )
ROM_LOAD( "dkremix.bin", 0x0000, 0x10000, CRC(f47c13aa) SHA1(c8516e27028d371a1f7b198f6d91f6a10bf99d3f) )
*/

ROM_REGION( 0x10000, REGION_CPU1, 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) )

ROM_REGION( 0x10000, REGION_USER1, 0 )
ROM_LOAD( "dkremix.bin", 0x0000, 0x10000, CRC(f47c13aa) SHA1(c8516e27028d371a1f7b198f6d91f6a10bf99d3f) )

ROM_REGION( 0x1800, REGION_CPU2, 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_LOAD( "s_3j_b.bin", 0x0800, 0x0800, CRC(4743fe92) SHA1(6c82b57637c0212a580591397e6a5a1718f19fd2) )

ROM_REGION( 0x1000, REGION_GFX1, 0 )
ROM_LOAD( "dkremix.5h", 0x0000, 0x0800, CRC(fc82b069) SHA1(ae78e6de0b50149a55f10f480c522f7a147ea106) )
Expand All @@ -2986,6 +2983,36 @@ ROM_START( dkremix )
ROM_LOAD( "v-5e.bpr", 0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
ROM_END

ROM_START( dkchrmx )
ROM_REGION( 0x10000, REGION_CPU1, 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) )

ROM_REGION( 0x20000, REGION_USER1, 0 )
ROM_LOAD( "dkchrmx.bin", 0x0000, 0x10000, CRC(e5273cee) SHA1(c440d47e7e3ca356ae1d748cc673393efb2b6c4a) )

ROM_REGION( 0x1800, REGION_CPU2, 0 ) /* sound */
ROM_LOAD( "s_3i_b.bin", 0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) )
// ROM_RELOAD( 0x0800, 0x0800 )
ROM_LOAD( "s_3j_b.bin", 0x0800, 0x0800, CRC(4743fe92) SHA1(6c82b57637c0212a580591397e6a5a1718f19fd2) )

ROM_REGION( 0x1000, REGION_GFX1, 0 )
ROM_LOAD( "v_5h_b.ch", 0x0000, 0x0800, CRC(0b92cc7a) SHA1(cd217c2b45a86744c2fc7df8a3b624489e07f01f) )
ROM_LOAD( "v_3pt.ch", 0x0800, 0x0800, CRC(6a04f93f) SHA1(b78342f89186c3d2b83fff6fd208afaba4584a5c) )

ROM_REGION( 0x2000, REGION_GFX2, 0 )
ROM_LOAD( "l_4m_b.ch", 0x0000, 0x0800, CRC(c6ddc85f) SHA1(4f19be0904460ec8494bad13b3b55292889e7400) )
ROM_LOAD( "l_4n_b.ch", 0x0800, 0x0800, CRC(2cd9cfdf) SHA1(fd9b0b75084661441680188ef3faf233579ceeb7) )
ROM_LOAD( "l_4r_b.ch", 0x1000, 0x0800, CRC(c1ea6688) SHA1(3509bb96d2da1f364d0cb4c60636933cdd42f6e3) )
ROM_LOAD( "l_4s_b.ch", 0x1800, 0x0800, CRC(9473d658) SHA1(2c5acf47c0ab8bd2e863e9bdea018d17ac4c96c8) )

ROM_REGION( 0x0300, REGION_PROMS, 0 )
ROM_LOAD( "c-2k.ch", 0x0000, 0x0100, CRC(c6cee97e) SHA1(6590b6815a0cb19b800bce0f504494217977ae44) )
ROM_LOAD( "c-2j.ch", 0x0100, 0x0100, CRC(1f64ac3d) SHA1(0591495a75a301772856c121f34299da4f9df341) )
ROM_LOAD( "v-5e.ch", 0x0200, 0x0100, CRC(5a8ca805) SHA1(8e711af73ddb20ed62a9a8b53f1150feab1dc051) )
ROM_END

static DRIVER_INIT( herodk )
{
Expand Down Expand Up @@ -3025,12 +3052,10 @@ static DRIVER_INIT( dkongx )
{
braze_decrypt_rom(memory_region(REGION_USER1) + 0x10000);

memset (memory_region(REGION_CPU1), 0, 0x10000);

banks = 0;
memcpy (memory_region(REGION_CPU1) + 0x0000, memory_region(REGION_USER1) + 0x10000, 0x06000);
memcpy (memory_region(REGION_CPU1) + 0x8000, memory_region(REGION_USER1) + 0x10000, 0x08000); /* ?*/
cpu_setbank(1, memory_region(REGION_USER1) + 0x10000);
cpu_setbank(2, memory_region(REGION_USER1) + 0x10000);


install_mem_write_handler(0, 0xe000, 0xe000, braze_a15_w);
install_mem_write_handler(0, 0xc800, 0xc800, braze_eeprom_w);
install_mem_read_handler(0, 0xc800, 0xc800, braze_eeprom_r);
Expand Down Expand Up @@ -3082,3 +3107,4 @@ GAMEX(1985, strtheat, 0, strtheat, strtheat, 0, ROT270, "Epos Cor
/* Braze Technologies bootleg hardware */
GAME (2008, dkongx, dkong, braze, dkongx, dkongx, ROT270, "bootleg", "Donkey Kong II - Jumpman Returns (Hack V1.2)" )
GAME (2015, dkremix, dkong, braze, dkongx, dkongx, ROT270, "bootleg", "Donkey Kong Remix" )
GAME( 2017, dkchrmx, dkong, braze, dkongx, dkongx, ROT270, "John Kowalski", "Donkey Kong Christmas Remix" )

0 comments on commit aed76b2

Please sign in to comment.