Previous 199869 Revisions Next

r19484 Wednesday 12th December, 2012 at 07:07:44 UTC by David Haywood
make said helper function a bit more helpful (nw)
[src/mame/drivers]bfm_sc2.c

trunk/src/mame/drivers/bfm_sc2.c
r19483r19484
21922192int sc2_find_project_string(running_machine &machine )
21932193{
21942194   // search for the title
2195   const int strlength = 14;
2196   char title_string[] = "PROJECT NUMBER";
2195   char title_string[2][16] = { "PROJECT NUMBER", "PROJECT PR" };
21972196   UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
21982197   int size = machine.root_device().memregion( "maincpu" )->bytes();
21992198
2200   for (int i=0;i<size-strlength;i++)
2199   for (int search=0;search<2;search++)
22012200   {
2202      int j;
2203      int found = 1;
2204      for (j=0;j<strlength;j+=1)
2205      {
2206         UINT8 rom = src[(i+j)];
2207         UINT8 chr = title_string[j];
22082201
2209         if (rom != chr)
2210         {
2211            found = 0;
2212            break;
2213         }
2214      }
2202      int strlength = strlen(title_string[search]);
22152203
2216      if (found!=0)
2204      for (int i=0;i<size-strlength;i++)
22172205      {
2206         int j;
2207         int found = 1;
2208         for (j=0;j<strlength;j+=1)
2209         {
2210            UINT8 rom = src[(i+j)];
2211            UINT8 chr = title_string[search][j];
22182212
2219         int end=0;
2220         int count = 0;
2221         int blankcount = 0;
2222         printf("ID String @ %08x\n", i);
2213            if (rom != chr)
2214            {
2215               found = 0;
2216               break;
2217            }
2218         }
22232219
2224         while (!end)
2220         if (found!=0)
22252221         {
2226            UINT8 rom;
2227            int addr;
22282222
2229            addr = (i+count);
2223            int end=0;
2224            int count = 0;
2225            int blankcount = 0;
2226            printf("ID String @ %08x\n", i);
22302227
2231            if (addr<size)
2228            while (!end)
22322229            {
2233               rom = src[addr];
2230               UINT8 rom;
2231               int addr;
2232
2233               addr = (i+count);
2234
2235               if (addr<size)
2236               {
2237                  rom = src[addr];
22342238         
2235               if ((rom>=0x20) && (rom<0x7f))
2236               {
2237                  printf("%c", rom);
2238                  blankcount = 0;
2239                  if ((rom>=0x20) && (rom<0x7f))
2240                  {
2241                     printf("%c", rom);
2242                     blankcount = 0;
2243                  }
2244                  else
2245                  {
2246                     blankcount++;
2247                     if (blankcount<10) printf(" ");
2248                  }
2249
2250                  count++;
22392251               }
22402252               else
2241               {
2242                  blankcount++;
2243                  if (blankcount<10) printf(" ");
2244               }
2253                  end = 1;
22452254
2246               count++;
2255               if (count>=0x100)
2256                  end = 1;
22472257            }
2248            else
2249               end = 1;
2258            printf("\n");
22502259
2251            if (count>=0x100)
2252               end = 1;
2260            return 1;
22532261         }
2254         printf("\n");
2255
2256         return 1;
22572262      }
22582263   }
22592264
r19483r19484
80458050GAME( 199?, sc2ptytm1   , sc2ptytm   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Party Time (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
80468051GAME( 199?, sc2ptytm1p   , sc2ptytm   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Party Time (Bellfruit) (set 2, Protocol) (Scorpion 2/3)", GAME_FLAGS)
80478052
8048GAME( 199?, sc2cops      , 0         ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
8049GAME( 199?, sc2copsp   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 1, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
8050GAME( 199?, sc2cops1p   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 2, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
8051GAME( 199?, sc2cops2   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
8053// PROJECT NUMBER 6589 (6012)  COPS & ROBBERS (SINGLE SITE 5P/10P/20P)  GAME No 95-750-577 - 4-DEC-1995 10:52:08
80528054GAME( 199?, sc2cops3   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 4)  (Scorpion 2/3)", GAME_FLAGS)
8055// PROJECT NUMBER 6589 (6012)  COPS & ROBBERS (SINGLE SITE 5P/10P/20P)  GAME No 95-751-577 - 4-DEC-1995 10:52:08
80538056GAME( 199?, sc2cops3p   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 4, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
8057// PROJECT NUMBER 6589 (6012)  COPS & ROBBERS (ARCADE 5P/10P/20P)  GAME No 95-751-578 - 4-DEC-1995 10:53:58
8058GAME( 199?, sc2copsp   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 1, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
8059// PROJECT NUMBER 6589 (6012)  COPS & ROBBERS (IRISH ALL CASH 5P/10P/20P)  GAME No 95-750-645 - 7-MAR-1996 15:07:40
80548060GAME( 199?, sc2cops4   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 5) (Scorpion 2/3)", GAME_FLAGS)
8061// PROJECT NUMBER 6589 (6012)  COPS & ROBBERS (#10 ALL CASH 20P/25P)  GAME No 95-750-652 - 15-MAR-1996 11:52:02
8062GAME( 199?, sc2cops      , 0         ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
8063// PROJECT NUMBER 6589 (6012)  COPS & ROBBERS (#10 ALL CASH 20P/25P)  GAME No 95-751-652 - 15-MAR-1996 11:52:02
8064GAME( 199?, sc2cops1p   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 2, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
8065
8066// PROJECT NUMBER 6012  COPS & ROBBERS #3/#6  GAME No 95-750-044 - 29-DEC-1992 21:26:28
80558067GAME( 199?, sc2cops5   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 6)  (Scorpion 2/3)", GAME_FLAGS)
8068// PROJECT NUMBER 6012  COPS AND ROBBERS S+P 10P  GAME No 95-750-110 - 7-JUL-1993 10:17:18
8069GAME( 199?, sc2cops2   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
80568070
80578071//Shows Nudge Now animation on bootup - using right ROMS?
80588072// PROJECT NUMBER 6622  BINGO COPS N ROBBERS #8/#10 ALL CASH  GAME No 95-750-814 - 9-JUL-1996 17:08:15

Previous 199869 Revisions Next


© 1997-2024 The MAME Team