Previous 199869 Revisions Next

r19483 Wednesday 12th December, 2012 at 06:48:58 UTC by David Haywood
helper functions to aid in further cleanup (nw)
[src/mame/drivers]bfm_sc2.c

trunk/src/mame/drivers/bfm_sc2.c
r19482r19483
21872187   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
21882188MACHINE_CONFIG_END
21892189
2190
2191
2192int sc2_find_project_string(running_machine &machine )
2193{
2194   // search for the title
2195   const int strlength = 14;
2196   char title_string[] = "PROJECT NUMBER";
2197   UINT8 *src = machine.root_device().memregion( "maincpu" )->base();
2198   int size = machine.root_device().memregion( "maincpu" )->bytes();
2199
2200   for (int i=0;i<size-strlength;i++)
2201   {
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];
2208
2209         if (rom != chr)
2210         {
2211            found = 0;
2212            break;
2213         }
2214      }
2215
2216      if (found!=0)
2217      {
2218
2219         int end=0;
2220         int count = 0;
2221         int blankcount = 0;
2222         printf("ID String @ %08x\n", i);
2223
2224         while (!end)
2225         {
2226            UINT8 rom;
2227            int addr;
2228
2229            addr = (i+count);
2230
2231            if (addr<size)
2232            {
2233               rom = src[addr];
2234         
2235               if ((rom>=0x20) && (rom<0x7f))
2236               {
2237                  printf("%c", rom);
2238                  blankcount = 0;
2239               }
2240               else
2241               {
2242                  blankcount++;
2243                  if (blankcount<10) printf(" ");
2244               }
2245
2246               count++;
2247            }
2248            else
2249               end = 1;
2250
2251            if (count>=0x100)
2252               end = 1;
2253         }
2254         printf("\n");
2255
2256         return 1;
2257      }
2258   }
2259
2260   return 0;
2261}
2262
2263
21902264static void sc2_common_init(running_machine &machine, int decrypt)
21912265{
21922266   bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
r19482r19483
38093883   Scorpion2_SetSwitchState(machine(),6,2, 0);
38103884   Scorpion2_SetSwitchState(machine(),6,3, 1);
38113885
3886   sc2_find_project_string(machine());
38123887}
38133888
38143889DRIVER_INIT_MEMBER(bfm_sc2_state,drwho_common)
38153890{
3816
38173891   MechMtr_config(machine(),8);
38183892
38193893   m_has_hopper = 0;
r19482r19483
38263900   Scorpion2_SetSwitchState(machine(),7,1, 0);     /* 20P High Level Switch */
38273901   Scorpion2_SetSwitchState(machine(),7,2, 0);     /* Token Front High Level Switch */
38283902   Scorpion2_SetSwitchState(machine(),7,3, 0);     /* Token Rear High Level Switch */
3903
3904   sc2_find_project_string(machine());
38293905}
38303906
38313907DRIVER_INIT_MEMBER(bfm_sc2_state,drwho)
r19482r19483
38453921{
38463922   sc2awp_common_init(machine(),6, 1);
38473923   MechMtr_config(machine(),5);
3924   sc2_find_project_string(machine());
38483925}
38493926
38503927DRIVER_INIT_MEMBER(bfm_sc2_state,cpeno1)
r19482r19483
38893966   m_sc2_door_state  = 0x31;
38903967
38913968   m_has_hopper = 0;
3969   sc2_find_project_string(machine());
38923970}
38933971
38943972DRIVER_INIT_MEMBER(bfm_sc2_state,ofah)
r19482r19483
39063984   Scorpion2_SetSwitchState(machine(),6,3,1);
39073985
39083986   MechMtr_config(machine(),3);
3909
3987   sc2_find_project_string(machine());
39103988}
39113989
39123990DRIVER_INIT_MEMBER(bfm_sc2_state,prom)
r19482r19483
39244002   Scorpion2_SetSwitchState(machine(),6,3,1);
39254003
39264004   MechMtr_config(machine(),3);
3927
4005   sc2_find_project_string(machine());
39284006}
39294007
39304008DRIVER_INIT_MEMBER(bfm_sc2_state,bfmcgslm)
r19482r19483
39324010   sc2awp_common_init(machine(),6, 1);
39334011   MechMtr_config(machine(),8);
39344012   m_has_hopper = 0;
4013   sc2_find_project_string(machine());
39354014}
39364015
39374016DRIVER_INIT_MEMBER(bfm_sc2_state,luvjub)
r19482r19483
39584037   Scorpion2_SetSwitchState(machine(),7,1,0);
39594038   Scorpion2_SetSwitchState(machine(),7,2,0);
39604039   Scorpion2_SetSwitchState(machine(),7,3,0);
4040   sc2_find_project_string(machine());
39614041}
39624042
39634043
r19482r19483
79758055GAME( 199?, sc2cops5   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Cops 'n' Robbers (Bellfruit) (set 6)  (Scorpion 2/3)", GAME_FLAGS)
79768056
79778057//Shows Nudge Now animation on bootup - using right ROMS?
8058// PROJECT NUMBER 6622  BINGO COPS N ROBBERS #8/#10 ALL CASH  GAME No 95-750-814 - 9-JUL-1996 17:08:15
79788059GAME( 199?, sc2copsc   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Casino Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)", GAME_FLAGS)
8060// PROJECT NUMBER 6622  BINGO COPS N ROBBERS #8/#10 ALL CASH  GAME No 95-751-814 - 9-JUL-1996 17:08:15
79798061GAME( 199?, sc2copscp   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Casino Cops 'n' Robbers (Bellfruit) (set 1, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
8062// PROJECT NUMBER 6622  BINGO COPS N ROBBERS SWITCHABLE BINGO/ARCADE  GAME No 95-750-816 - 9-JUL-1996 17:12:33
79808063GAME( 199?, sc2copsc1   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Casino Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)", GAME_FLAGS)
8064// PROJECT NUMBER 6622  BINGO COPS N ROBBERS SWITCHABLE BINGO/ARCADE  GAME No 95-751-816 - 9-JUL-1996 17:12:33  (sc2copsc1p / sc2copsc2 are the same set with different matrix rom??)
79818065GAME( 199?, sc2copsc1p   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Casino Cops 'n' Robbers (Bellfruit) (set 2, Protocol)  (Scorpion 2/3)", GAME_FLAGS)
79828066GAME( 199?, sc2copsc2   , sc2cops   ,  scorpion2_dm01   , drwho      , bfm_sc2_state, ofah      , 0,       "BFM",      "Casino Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)", GAME_FLAGS)
79838067

Previous 199869 Revisions Next


© 1997-2024 The MAME Team