Jump to content

NeoGeo games drivers - I need help.


Recommended Posts

Ok I gotting an error on the src\machine\neogeo.c

 

In function 'mslug5p_bankswitch_w'

 

warning: implicit declaration of function 'cpu_setbank'

 

static WRITE16_HANDLER ( mslug5p_bankswitch_w )
{
       /* thanks to fataku for the info */
       unsigned char *RAM = memory_region(REGION_CPU1);
       int bankaddress;
       logerror("offset: %06x PC %06x: set banking %04x\n",offset,activecpu_get_pc(),data);
       if ((offset == 0)&&(data == 0xa0))
       {
               bankaddress=0xa0;
               cpu_setbank(4,&RAM[bankaddress]);
               //neogeo_set_cpu1_second_bank(bankaddress);
               logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,activecpu_get_pc(),bankaddress);
       }
       else if(offset == 2)
       {  data=data>>4;
          //data=data&7;
          bankaddress=data*0x100000;
          cpu_setbank(4,&RAM[bankaddress]);
          //neogeo_set_cpu1_second_bank(bankaddress);
          logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,activecpu_get_pc(),bankaddress);
       }
}

=========================================

if (!strcmp(Machine->gamedrv->name,"ms5plus") )
       {
       /* special ROM banking handler */
       memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, mslug5p_bankswitch_w );

       /* additional protection */
       memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, mslug5_prot_r );       
   }

 

ROM_START( ms5plus )
ROM_REGION( 0x500000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "268-p1p.bin", 0x000000, 0x100000, CRC(106b276f) )
ROM_LOAD16_WORD_SWAP( "268-p2p.bin", 0x100000, 0x200000, CRC(d6a458e8) )
ROM_LOAD16_WORD_SWAP( "268-p3p.bin", 0x300000, 0x200000, CRC(439ec031) )

ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_LOAD("268-s1p.bin", 0x000000, 0x20000, CRC(21e04432) )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x40000, REGION_USER4, 0 )
ROM_LOAD( "268-m1.bin", 0x00000, 0x40000, CRC(88c11f51) SHA1(5592819be64b69ab361d3b6b139fc68d8cabd29d) )
NEO_BIOS_SOUND_256K( "268-m1d.bin", CRC(6866d696) SHA1(3638b072e44277a6bffea5a78a915a14c6afcba0) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0)
ROM_LOAD( "268-v1.bin", 0x000000, 0x800000, CRC(33c6305c) SHA1(67fce35a62941d2dcec75f0e6319677d6df7a4dc) )
ROM_LOAD( "268-v2.bin", 0x800000, 0x800000, CRC(1afb848e) SHA1(368e950043deebc91f7b38be770fa1045a0153af) )
	 
ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "ms5n_c1.rom", 0x0000000, 0x800000, CRC(969c0d62) )
ROM_LOAD16_BYTE( "ms5n_c2.rom", 0x0000001, 0x800000, CRC(c69ae867) )
ROM_LOAD16_BYTE( "ms5n_c3.rom", 0x1000000, 0x800000, CRC(d7beaeaf) )
ROM_LOAD16_BYTE( "ms5n_c4.rom", 0x1000001, 0x800000, CRC(899fb2af) )
ROM_LOAD16_BYTE( "ms5n_c5.rom", 0x2000000, 0x800000, CRC(2fa1a5ad) )
ROM_LOAD16_BYTE( "ms5n_c6.rom", 0x2000001, 0x800000, CRC(6de89589) )
ROM_LOAD16_BYTE( "ms5n_c7.rom", 0x3000000, 0x800000, CRC(97bd0c0a) )
ROM_LOAD16_BYTE( "ms5n_c8.rom", 0x3000001, 0x800000, CRC(c0d5bc20) )
ROM_END

==========================================

DRIVER_INIT( ms5plus )
{
   UINT8 *dst = osd_malloc(0x20000);
   UINT8 *roms1 = (memory_region(REGION_GFX1));
   int j;
   if ( dst )
   {
           memcpy(dst,roms1,0x20000);
           // descrambling the S1 by dorriGa
           for (j=0;j<0x20000; j+=0x000010)
           {
                   memcpy( roms1+j, dst+j+0x000008,8);
                   memcpy( roms1+j+0x000008, dst+j,8);
                      
           }
   }
   free( dst );
   neogeo_fix_bank_type = 1;
   mslug5_vx_decrypt();
 init_neogeo();	
}

 

Let me know what to fixs. ;)

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

I don't know why people still insist on using that crappy ms5plus code:

 

Here's the same code, but with everything that isn't used removed/merged

static WRITE16_HANDLER ( mslug5p_bankswitch_w )
{
/* thanks to fataku for the info */
if(offset == 2)
{
 neogeo_set_cpu1_second_bank(data<<16);
}
}

 

if (!strcmp(Machine->gamedrv->name,"ms5plus") )
{
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, mslug5p_bankswitch_w );       
}

Edited by iq_132
Link to comment
Share on other sites

why does the first part say WRITE16_handler and the 2nd part say READ16_handler ??

 

It kind of like turn on the machine. It write, read next and then load the game. :)

 

Hmmm...It doesn't like it.

 

Errror report.

 

scr/machine/neogeo.c

 

In function 'neogeo_custom_memory' :

 

warning: passing arg 7 of '_memory_install_read16_handler' from incompatible pointer type

 

It talking about this bellow. It missing something there.

 

if (!strcmp(Machine->gamedrv->name,"ms5plus") )
       {
       memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, mslug5p_bankswitch_w );      
}

 

Oh ok. It missing this one.

 

       memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, mslug5_prot_r );      
  }

 

Because of this.

 

static READ16_HANDLER( mslug5_prot_r )
{
       logerror("PC %06x: access protected\n",activecpu_get_pc());
       return 0xa0;
}

 

I just now figger it out nnow.

Edited by KillerBee
Link to comment
Share on other sites

why does the first part say WRITE16_handler and the 2nd part say READ16_handler ??

Lol, you're exactly right. It should be just a write16 handler.

 

 

@ hanco, check my post above. It only needs the bankswitch code I posted and not any more of it.

And before you dumb out on me, yes, you still need the code in the init.

Link to comment
Share on other sites

Now that the little error has been fixed, I've decided to use your code and get rid of the convoluted stuff.

 

It worked first go.  ;)

lol, yeah. I should pay more attention to code that I'm modifying when I post it. :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...