Jump to content

Adding games


Robert

Recommended Posts

  • Replies 70
  • Created
  • Last Reply

Top Posters In This Topic

Today I've gotten svcboot to work, and I've added samsh5sp

which is working as well.

 

Spent the rest of the evening playing around with kog (King of Gladiator). Got the s rom worked out, but having trouble with the c roms - graphics are messed up.

Link to comment
Share on other sites

The driver is not complete yet. But here is how the roms are loaded.

 

ROM_START( kog )

ROM_REGION( 0x600000, REGION_CPU1, 0 )

ROM_LOAD16_WORD_SWAP( "5232-p1.bin", 0x000000, 0x200000, CRC(d2413ec6) SHA1(c0bf409d1e714cba5fdc6f79e4c2aec805316634) )

ROM_LOAD16_WORD_SWAP( "232-p2.bin", 0x200000, 0x400000, CRC(158b23f6) SHA1(9744620a70513490aaf9c5eda33e5ec31222be19) )

 

NEO_SFIX_128K( "5232-s1.bin", CRC(0bef69da) SHA1(80918586e694dce35c4dba796eb18abf6a070ebb) )

 

NEO_BIOS_SOUND_128K( "232-m1.bin", CRC(45348747) SHA1(ed77cbae2b208d1177a9f5f6e8cd57070e90b65b) )

 

ROM_REGION( 0xc00000, REGION_SOUND1, ROMREGION_SOUNDONLY )

ROM_LOAD( "232-v1.bin", 0x000000, 0x400000, CRC(22a2b5b5) SHA1(ebdbc977332e6d93e266755000b43857e0082965) )

ROM_LOAD( "232-v2.bin", 0x400000, 0x400000, CRC(2304e744) SHA1(98d283e2bcc9291a53f52afd35ef76dfb0828432) )

ROM_LOAD( "232-v3.bin", 0x800000, 0x400000, CRC(759eb954) SHA1(54e77c4e9e6b89458e59824e478ddc33a9c72655) )

 

NO_DELTAT_REGION

 

ROM_REGION( 0x2800000, REGION_GFX3, 0 )

ROM_LOAD16_BYTE( "5232-c1a.bin", 0x0000000, 0x800000, CRC(4eab9b0a) SHA1(a6f6b755215a3f41474e0a76b5463303a522c2d3) ) /* Plane 0,1 */

ROM_LOAD16_BYTE( "5232-c2a.bin", 0x0000001, 0x800000, CRC(697f8fd0) SHA1(5784464c2357ccef8e6e79b6298843fc3d13b39c) ) /* Plane 2,3 */

ROM_LOAD16_BYTE( "5232-c1b.bin", 0x1000000, 0x800000, CRC(1143fdf3) SHA1(9dc5fe9a3b7599380db62095880e2d6f237a41bd) ) /* Plane 0,1 */

ROM_LOAD16_BYTE( "5232-c2b.bin", 0x1000001, 0x800000, CRC(ea82cf8f) SHA1(3d9ab64b69cecd6b3950839ac2c6d151ad66dcf8) ) /* Plane 2,3 */

ROM_LOAD16_BYTE( "5232-c3.bin", 0x2000000, 0x400000, CRC(abd1be07) SHA1(857eb68bbee4538770bbfa77aaa540d61ab0abcd) ) /* Plane 0,1 */

ROM_LOAD16_BYTE( "5232-c4.bin", 0x2000001, 0x400000, CRC(d2bd967b) SHA1(c494e0a98e127d37ca360a28accc167fa50fb626) ) /* Plane 2,3 */

ROM_END

Link to comment
Share on other sites

Thankyou sir, I can see I was loading the c roms in the wrong order.

 

Now, I've worked out the so-called "encryption" of

the C roms - I found a suitable subroutine,

and the graphics are now perfect.

 

The p1 rom is the major obstacle as part of it appears to be encrypted.

Booting up produces a red screen at the moment.

Link to comment
Share on other sites

Got a little further with kog. When it should show neogeo snk screen,

it shows a crosshatch pattern instead, and stops.

 

What does this mean?

It usually means that the P1 rom is still encrypted and/or corrupted.

Link to comment
Share on other sites

Got a little further with kog. When it should show neogeo snk screen,

it shows a crosshatch pattern instead, and stops.

 

What does this mean?

 

 

 

 

static void kog_cx_decrypt( void )
{
int i;
int cx_size = memory_region_length( REGION_GFX3 );
UINT8 *rom = memory_region( REGION_GFX3 );
UINT8 *buf = malloc( cx_size );

memcpy( buf, rom, cx_size );

for( i = 0; i < cx_size / 0x40; i++ ){
 memcpy( &rom[ i * 0x40 ], &buf[ (i ^ 1) * 0x40 ], 0x40 );
}

free( buf );
}

static void kog_sx_decrypt( void )
{
int i;
int sx_size = memory_region_length( REGION_GFX1 );
UINT8 *rom = memory_region( REGION_GFX1 );
UINT8 *buf = malloc( sx_size );

memcpy( buf, rom, sx_size );

for( i = 0; i < sx_size; i += 0x10 ){
 memcpy( &rom[ i        ], &buf[ i + 0x08 ], 0x08 );
 memcpy( &rom[ i + 0x08 ], &buf[ i        ], 0x08 );
}

free( buf );
}

// Code by IQ_132 -- [url=http://neosource.1emulation.com/]http://neosource.1emulation.com/[/url]
// Thanks to JotaCE, Jimmy_page, and Robber804 for some info
DRIVER_INIT( kog )
{
int i;
UINT8 *src = memory_region(REGION_CPU1);
UINT8 *dst = (UINT8*)malloc(0x600000);

if (dst)
{
 unsigned int nBank[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
 
 memcpy (dst, src, 0x200000);

 for (i = 0; i < 8; i++) {
	 memcpy (src + i * 0x20000, dst + nBank[i] * 0x20000, 0x20000);
 }

 memcpy (src + 0x100000, src + 0x200000, 0x400000);
 memcpy( dst+0x000000, src+0x1A0000, 0x020000 ); 
 memcpy( dst+0x020000, src+0x080000, 0x020000 );
 memcpy( dst+0x040000, src+0x140000, 0x020000 ); 
 memcpy( dst+0x060000, src+0x000000, 0x020000 );
 memcpy( dst+0x080000, src+0x180000, 0x020000 );
 memcpy( dst+0x0A0000, src+0x0A0000, 0x020000 ); 
 memcpy( dst+0x0C0000, src+0x100000, 0x020000 ); 
 memcpy( dst+0x0E0000, src+0x040000, 0x020000 ); 
 memcpy( dst+0x100000, src+0x500000, 0x100000 ); 
 memcpy( dst+0x200000, src+0x400000, 0x100000 ); 
 memcpy( dst+0x300000, src+0x300000, 0x100000 ); 
 memcpy( dst+0x400000, src+0x200000, 0x100000 ); 
 
 free(dst);
}

kog_cx_decrypt();
kog_sx_decrypt();
init_neogeo();
}

Link to comment
Share on other sites

Thank you again sir. You've saved me about 2 weeks of work,

I would have got there eventually, I swear. (j/k)

 

It runs pretty well, there's just that bad graphics in the title screen that you mentioned.

 

I've tidied up that code and removed the redundant and duplicated stuff. It works the same - I tested it.

//----------------------------------------------------------------------kog experimental code
DRIVER_INIT( kog )
{
UINT8 *rom = memory_region( REGION_CPU1 );
UINT8 *buf = malloc( 0x100000 );
int i;
unsigned int nBank[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };

for (i = 0; i < 8; i++)
{
 memcpy (buf + i * 0x20000, rom + nBank[i] * 0x20000, 0x20000);
}
memcpy( &rom[ 0x000000 ], &buf[ 0x000000 ], 0x100000);  //move unscrambled p1 back

memcpy( &rom[ 0x100000 ], &rom[ 0x200000 ], 0x400000);  //move p2 rom to original location

free(buf);

samsh5bl_sx_decrypt();   //works
samsh5bl_cx_decrypt();   //works

init_neogeo();
}

Link to comment
Share on other sites

Yes I know about the samsh5bl driver and thats where part of the code came from.

I put it like that because not everyone uses that rom set.

 

 

And yes there are GFX problems thats why I said the driver is not complete :P

Link to comment
Share on other sites

Did a big clean/tidyup of neogeo.c, removed various un-needed codes, commented out code for games i'm not implementing... and finally found a fix for svcplus/svcplusa. I'd left out the px_hack routine.

 

Now, every driver for which I have the roms is working!

 

Decided to add kof10thu and kf10thep, only to discover I don't possess the encrypted kof10thu roms. Therefore I made a kf10thud and substituted the p1 and s1 roms from the nrx set. Two more working games!

 

While watching kof10th attract mode, I discovered that the neogeo/snk screen is corrupted. Since my new kf10thud uses exactly the same c roms without problems, the fault must lie either in the p1-program, or in the driver. This needs to be investigated.

 

This exercise has been a great learning experience, I have thoroughly enjoyed it. Thanks to James for his assistance! :thumbsup1:

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...