From 80d61a8f86a4fb60a7ad090bab51c0c6d2d6b1bc Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Sat, 13 Sep 2014 06:14:35 +0000 Subject: [PATCH] (MESS) a2600: when loading from softlist, let's rely on the xml to detect oncart RAM instead of using custom routines. nw. --- hash/a2600.xml | 110 +++++++++++++++++++++++++++++++++++++ src/emu/bus/vcs/vcs_slot.c | 61 ++++++++++---------- 2 files changed, 142 insertions(+), 29 deletions(-) diff --git a/hash/a2600.xml b/hash/a2600.xml index 4d50e95ed7f..9b19ddf7c7c 100644 --- a/hash/a2600.xml +++ b/hash/a2600.xml @@ -2810,6 +2810,8 @@ Info from Atariage and Atarimania + + @@ -2858,6 +2860,8 @@ Info from Atariage and Atarimania + + @@ -4136,6 +4140,8 @@ Info from Atariage and Atarimania + + @@ -4355,6 +4361,8 @@ Info from Atariage and Atarimania + + @@ -4382,6 +4390,8 @@ Info from Atariage and Atarimania + + @@ -4495,6 +4505,8 @@ Info from Atariage and Atarimania + + @@ -4509,6 +4521,8 @@ Info from Atariage and Atarimania + + @@ -4523,6 +4537,8 @@ Info from Atariage and Atarimania + + @@ -4649,6 +4665,8 @@ Info from Atariage and Atarimania + + @@ -4663,6 +4681,8 @@ Info from Atariage and Atarimania + + @@ -4876,6 +4896,8 @@ Info from Atariage and Atarimania + + @@ -4890,6 +4912,8 @@ Info from Atariage and Atarimania + + @@ -4904,6 +4928,8 @@ Info from Atariage and Atarimania + + @@ -5017,6 +5043,8 @@ Info from Atariage and Atarimania + + @@ -5031,6 +5059,8 @@ Info from Atariage and Atarimania + + @@ -5600,6 +5630,8 @@ Info from Atariage and Atarimania + + @@ -5963,6 +5995,8 @@ Info from Atariage and Atarimania + + @@ -5977,6 +6011,8 @@ Info from Atariage and Atarimania + + @@ -7921,6 +7957,8 @@ Info from Atariage and Atarimania + + @@ -7935,6 +7973,8 @@ Info from Atariage and Atarimania + + @@ -8364,6 +8404,8 @@ Info from Atariage and Atarimania + + @@ -8378,6 +8420,8 @@ Info from Atariage and Atarimania + + @@ -8392,6 +8436,8 @@ Info from Atariage and Atarimania + + @@ -8923,6 +8969,8 @@ Info from Atariage and Atarimania + + @@ -9103,6 +9151,8 @@ Info from Atariage and Atarimania + + @@ -9405,6 +9455,8 @@ Info from Atariage and Atarimania + + @@ -9419,6 +9471,8 @@ Info from Atariage and Atarimania + + @@ -9433,6 +9487,8 @@ Info from Atariage and Atarimania + + @@ -9448,6 +9504,8 @@ Info from Atariage and Atarimania + + @@ -9463,6 +9521,8 @@ Info from Atariage and Atarimania + + @@ -10088,6 +10148,8 @@ Info from Atariage and Atarimania + + @@ -10579,6 +10641,8 @@ Info from Atariage and Atarimania + + @@ -10593,6 +10657,8 @@ Info from Atariage and Atarimania + + @@ -10661,6 +10727,8 @@ Info from Atariage and Atarimania + + @@ -12299,6 +12367,8 @@ Info from Atariage and Atarimania + + @@ -12313,6 +12383,8 @@ Info from Atariage and Atarimania + + @@ -13341,6 +13413,8 @@ Info from Atariage and Atarimania + + @@ -13355,6 +13429,8 @@ Info from Atariage and Atarimania + + @@ -13655,6 +13731,8 @@ Info from Atariage and Atarimania + + @@ -13669,6 +13747,8 @@ Info from Atariage and Atarimania + + @@ -13740,6 +13820,8 @@ Info from Atariage and Atarimania + + @@ -13754,6 +13836,8 @@ Info from Atariage and Atarimania + + @@ -15099,6 +15183,8 @@ Info from Atariage and Atarimania + + @@ -15113,6 +15199,8 @@ Info from Atariage and Atarimania + + @@ -15591,6 +15679,8 @@ Info from Atariage and Atarimania + + @@ -15605,6 +15695,8 @@ Info from Atariage and Atarimania + + @@ -16043,6 +16135,8 @@ Info from Atariage and Atarimania + + @@ -16116,6 +16210,8 @@ Info from Atariage and Atarimania + + @@ -16143,6 +16239,8 @@ Info from Atariage and Atarimania + + @@ -17197,6 +17295,8 @@ Info from Atariage and Atarimania + + @@ -17210,6 +17310,8 @@ Info from Atariage and Atarimania + + @@ -17571,6 +17673,8 @@ Info from Atariage and Atarimania + + @@ -17585,6 +17689,8 @@ Info from Atariage and Atarimania + + @@ -17899,6 +18005,8 @@ Info from Atariage and Atarimania + + @@ -17912,6 +18020,8 @@ Info from Atariage and Atarimania + + diff --git a/src/emu/bus/vcs/vcs_slot.c b/src/emu/bus/vcs/vcs_slot.c index 420533d87f7..7406cf76272 100755 --- a/src/emu/bus/vcs/vcs_slot.c +++ b/src/emu/bus/vcs/vcs_slot.c @@ -216,6 +216,7 @@ bool vcs_cart_slot_device::call_load() if (software_entry() != NULL) { const char *pcb_name; + bool has_ram = get_software_region("ram") ? TRUE : FALSE; memcpy(ROM, get_software_region("rom"), len); if ((pcb_name = get_feature("slot")) != NULL) @@ -258,45 +259,47 @@ bool vcs_cart_slot_device::call_load() printf("Unrecognized cart type!\n"); break; } - } + + if (has_ram) + m_cart->ram_alloc(get_software_region_length("ram")); } else { fread(ROM, len); m_type = identify_cart_type(ROM, len); + + // check for Special Chip (128bytes of RAM) + if (len == 0x2000 || len == 0x4000 || len == 0x8000) + if (detect_super_chip(ROM, len)) + { + m_cart->ram_alloc(0x80); + //printf("Super Chip detected!\n"); + } + // Super chip games: + // dig dig, crystal castles, millipede, stargate, defender ii, jr. Pac Man, + // desert falcon, dark chambers, super football, sprintmaster, fatal run, + // off the wall, shooting arcade, secret quest, radar lock, save mary, klax + + // add CBS RAM+ (256bytes of RAM) + if (m_type == A26_FA) + m_cart->ram_alloc(0x100); + // add M Network RAM + else if (m_type == A26_E7) + m_cart->ram_alloc(0x800); + // add Commavid RAM + else if (m_type == A26_CV) + m_cart->ram_alloc(0x400); + // add Starpath Superchager RAM + else if (m_type == A26_SS) + m_cart->ram_alloc(0x1800); + // add Boulder Dash RAM + else if (m_type == A26_3E) + m_cart->ram_alloc(0x8000); } //printf("Type: %s\n", vcs_get_slot(m_type)); - // check for Special Chip (128bytes of RAM) - if (len == 0x2000 || len == 0x4000 || len == 0x8000) - if (detect_super_chip(ROM, len)) - { - m_cart->ram_alloc(0x80); - //printf("Super Chip detected!\n"); - } - // Super chip games: - // dig dig, crystal castles, millipede, stargate, defender ii, jr. Pac Man, - // desert falcon, dark chambers, super football, sprintmaster, fatal run, - // off the wall, shooting arcade, secret quest, radar lock, save mary, klax - - // add CBS RAM+ (128bytes of RAM) - if (m_type == A26_FA) - m_cart->ram_alloc(0x100); - // add M Network RAM - else if (m_type == A26_E7) - m_cart->ram_alloc(0x800); - // add Commavid RAM - else if (m_type == A26_CV) - m_cart->ram_alloc(0x400); - // add Starpath Superchager RAM - else if (m_type == A26_SS) - m_cart->ram_alloc(0x1800); - // add Boulder Dash RAM - else if (m_type == A26_3E) - m_cart->ram_alloc(0x8000); - // pass a pointer to the now allocated ROM for the DPC chip if (m_type == A26_DPC) m_cart->setup_addon_ptr((UINT8 *)m_cart->get_rom_base() + 0x2000);