Previous 15994 Revisions Next

r5531 Saturday 29th August, 2009 at 21:28:35 UTC by Roberto Zandonà
[C64] implemented carts type #8
[src/mess/machine]c64.c

src/mess/machine/c64.c
r5530r5531
11181118         case SIMONS_BASIC:   /* Type #  4 */
11191119         case OCEAN_1:      /* Type #  5 */
11201120         case EXPERT:      /* Type #  6 */
1121         case FUN_PLAY:          /* Type #  7 */
1121         case FUN_PLAY:      /* Type #  7 */
1122         case SUPER_GAMES:      /* Type #  8 */
11221123         case ATOMIC_POWER:   /* Type #  9 */
11231124         case EPYX_FASTLOAD:   /* Type # 10 */
11241125         case WESTERMANN:      /* Type # 11 */
r5530r5531
12561257      c64_game  = cbm_c64_game;
12571258   }
12581259
1259
12601260   /* Finally load the cart */
12611261   roml = c64_roml;
12621262   romh = c64_romh;
r5530r5531
13071307         logerror("Warning: This cart type should have at most 4 banks and the cart looked for bank %d... Something strange is going on!\n", bank);
13081308      else
13091309      {
1310//         memcpy(mem + c64_cbm_cart[bank].addr, cart + c64_cbm_cart[bank].start, c64_cbm_cart[bank].size);
13111310         memcpy(roml, cart + bank * 0x4000, 0x2000);
13121311         memcpy(romh, cart + bank * 0x4000 + 0x2000, 0x2000);
1312/*
13131313         if (log_cart)
13141314         {
13151315            logerror("bank %d of size %d successfully loaded at %d!\n", bank, c64_cbm_cart[bank].size, c64_cbm_cart[bank].addr);
13161316            if (c64_cbm_cart[bank].index != bank)
13171317               logerror("Warning: According to the CHIP info this should be bank %d, but we are loading it as bank %d!\n", c64_cbm_cart[bank].index, bank);
13181318         }
1319*/
13191320      }
13201321   }
13211322}
r5530r5531
13231324static WRITE8_HANDLER( ocean1_bank_w )
13241325{
13251326   // Type # 5
1326   // working: Ghostbusters, Terminator 2
1327   // working: Double Dragon, Ghostbusters, Terminator 2
13271328   // not working: Pang, Robocop 2, Toki
13281329
13291330   UINT8 bank = data & 0x3f;
r5530r5531
13681369      real_bank = ((bank & 0x01) << 3) + ((bank & 0x38) >> 3);
13691370
13701371      memcpy(roml, cart + real_bank * 0x2000, 0x2000);
1371
1372/*
13721373      if (log_cart)
13731374      {
13741375         logerror("bank %d of size %d successfully loaded at %d!\n", bank, c64_cbm_cart[bank].size, c64_cbm_cart[bank].addr);
13751376         if (c64_cbm_cart[bank].index != bank)
13761377            logerror("Warning: According to the CHIP info this should be bank %d, but we are loading it as bank %d!\n", c64_cbm_cart[bank].index, bank);
13771378      }
1379*/
13781380   }
13791381}
13801382
1383static WRITE8_HANDLER( supergames_bank_w )
1384{
1385   // Type # 8
1386   // working:
1387   // not working:
1388
1389   UINT8 bank = data & 0x03, bit2 = data & 0x04;
1390   UINT8 *cart = memory_region(space->machine, "cart");
1391
1392   if (data & 0x04)
1393   {
1394      c64_game = 0;
1395      c64_exrom = 0;
1396   }
1397   else
1398   {
1399      c64_game = 0;
1400      c64_exrom = 0;
1401   }
1402
1403   if (data == 0xc)
1404   {
1405      c64_game = 1;
1406      c64_exrom = 1;
1407   }
1408
1409   if (bit2)
1410   {
1411      memcpy(roml, cart + bank * 0x4000, 0x2000);
1412      memcpy(romh, cart + bank * 0x4000 + 0x2000, 0x2000);
1413   }
1414   else
1415   {
1416      memcpy(roml, cart + bank * 0x4000, 0x2000);
1417      memcpy(romh, cart + bank * 0x4000 + 0x2000, 0x2000);
1418   }
1419}
1420
13811421static WRITE8_HANDLER( c64gs_bank_w )
13821422{
13831423   // Type # 15
r5530r5531
13911431      logerror("Warning: This cart type should have at most 64 banks and the cart looked for bank %d... Something strange is going on!\n", bank);
13921432
13931433   memcpy(roml, cart + bank * 0x2000, 0x2000);
1394
1434/*
13951435   if (log_cart)
13961436   {
13971437      logerror("bank %d of size %d successfully loaded at %d!\n", bank, c64_cbm_cart[bank].size, c64_cbm_cart[bank].addr);
13981438      if (c64_cbm_cart[bank].index != bank)
13991439         logerror("Warning: According to the CHIP info this should be bank %d, but we are loading it as bank %d!\n", c64_cbm_cart[bank].index, bank);
14001440   }
1441*/
14011442}
14021443
14031444static READ8_HANDLER( dinamic_bank_r )
r5530r5531
14131454      logerror("Warning: This cart type should have 16 banks and the cart looked for bank %d... Something strange is going on!\n", bank);
14141455
14151456   memcpy(roml, cart + bank * 0x2000, 0x2000);
1416
1457/*
14171458   if (log_cart)
14181459   {
14191460      logerror("bank %d of size %d successfully loaded at %d!\n", bank, c64_cbm_cart[bank].size, c64_cbm_cart[bank].addr);
14201461      if (c64_cbm_cart[bank].index != bank)
14211462         logerror("Warning: According to the CHIP info this should be bank %d, but we are loading it as bank %d!\n", c64_cbm_cart[bank].index, bank);
14221463   }
1423
1464*/
14241465   return 0;
14251466}
14261467
r5530r5531
14751516      case FUN_PLAY:          /* Type #  7 - 16 8k banks, loaded at 0x8000, banks chosen by writing to 0xde00 */
14761517         memory_install_write8_handler( space, 0xde00, 0xde00, 0, 0, funplay_bank_w );
14771518         break;
1519      case SUPER_GAMES:      /* Type #  8 not working */
1520         memory_install_write8_handler( space, 0xdf00, 0xdf00, 0, 0, supergames_bank_w );
1521         break;
14781522      case ATOMIC_POWER:   /* Type #  9 not working */
14791523         break;
14801524      case EPYX_FASTLOAD:   /* Type # 10 not working */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team