Author Topic: Error inserting a neogeo game in MAME 0.153 (Updated source from 148)  (Read 7660 times)

Offline gamez fan

  • Expert
  • *****
  • Posts: 498
  • Karma: +13/-1
  • Arcade Addict
Re: Error inserting a neogeo game in MAME 0.148
« Reply #15 on: June 24, 2014, 08:14:52 pm »
games loading fine, but the problem continue... only in mame and this game is totally decrypted

If the game boots and the graphics are ok but it crashes in game maybe it's related to encryption/decryption Machine commands??
im no expert but i noticed you have the driver init set like this........

Quote
DRIVER_INIT_MEMBER(neogeo_state,kof2k2c2)
{
   DRIVER_INIT_CALL(neogeo);
   kf2k2mp2_px_decrypt(machine());
   neo_pcm2_swap(machine(), 0);
   neogeo_cmc50_m1_decrypt(machine());
   neogeo_bootleg_sx_decrypt(machine(), 1);
   cmc50_neogeo_gfx_decrypt(machine(), 0xec);
}

kf2k2mp2_px_decrypt(machine()); did you add a encryption/decryption scheme for this define to the neocrypt.c machine file ??
something like this one for sv chaos......

Quote
       void svc_px_decrypt(running_machine &machine)
   {
       static const UINT8 xor1[ 0x20 ] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f };
       static const UINT8 xor2[ 0x20 ] = { 0x69, 0x0b, 0x60, 0xd6, 0x4f, 0x01, 0x40, 0x1a, 0x9f, 0x0b, 0xf0, 0x75, 0x58, 0x0e, 0x60, 0xb4, 0x14, 0x04, 0x20, 0xe4, 0xb9, 0x0d, 0x10, 0x89, 0xeb, 0x07, 0x30, 0x90, 0x50, 0x0e, 0x20, 0x26 };
       int i;
       int ofst;
       int rom_size = 0x800000;
       UINT8 *rom = machine.root_device().memregion( "maincpu" )->base();
       UINT8 *buf = auto_alloc_array(machine, UINT8,  rom_size );
   
             for( i = 0; i < 0x100000; i++ )
       {
             rom[ i ] ^= xor1[ (BYTE_XOR_LE(i) % 0x20) ];
       }
             for( i = 0x100000; i < 0x800000; i++ )
       {
             rom[ i ] ^= xor2[ (BYTE_XOR_LE(i) % 0x20) ];
       }
   
           for( i = 0x100000; i < 0x0800000; i += 4 )
       {
           UINT16 rom16;
           rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)]<<8;
           rom16 = BITSWAP16( rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 );
           rom[BYTE_XOR_LE(i+1)] = rom16&0xff;
           rom[BYTE_XOR_LE(i+2)] = rom16>>8;
       }
           memcpy( buf, rom, rom_size );
           for( i = 0; i < 0x0100000 / 0x10000; i++ )
       {
          ofst = (i & 0xf0) + BITSWAP8( (i & 0x0f), 7, 6, 5, 4, 2, 3, 0, 1 );
          memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 );
       }
        for( i = 0x100000; i < 0x800000; i += 0x100 )
       {
       ofst = (i & 0xf000ff) + ((i & 0x000f00) ^ 0x00a00) + (BITSWAP8( ((i & 0x0ff000) >> 12), 4, 5, 6, 7, 1, 0, 3, 2 ) << 12);
       memcpy( &rom[ i ], &buf[ ofst ], 0x100 );
       }
      memcpy( buf, rom, rom_size );
      memcpy( &rom[ 0x100000 ], &buf[ 0x700000 ], 0x100000 );
      memcpy( &rom[ 0x200000 ], &buf[ 0x100000 ], 0x600000 );
      auto_free( machine, buf );
      }
 
« Last Edit: June 24, 2014, 08:19:45 pm by gamez fan »

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.148
« Reply #16 on: June 24, 2014, 10:04:40 pm »
kof2k2c2 is running perfectly, the problem now is with the set above, kof2k2js / kf2k2js2 / kf2k2js3

These games are giving problem while Iori's DM

Nor is it necessary even in kof2k2c2 this statement above, because my rom is decrypted, then it really becomes unnecessary (at least working 100% here)

I just took the topic ever created for not even having to open another.

Quote
kf2k2mp2_px_decrypt(machine()); did you add a encryption/decryption scheme for this define to the neocrypt.c machine file ??
something like this one for sv chaos......

Yes, but is not used by kof2k2c2 and the hacks that I'm trying to add, I thought I needed but did not, because all the roms are decrypted, the reason I say this is that in Kawaks, if not decrypted, does not work properly.
« Last Edit: June 24, 2014, 10:07:30 pm by SeiferAlmasy »

Offline gamez fan

  • Expert
  • *****
  • Posts: 498
  • Karma: +13/-1
  • Arcade Addict
Re: Error inserting a neogeo game in MAME 0.148
« Reply #17 on: June 25, 2014, 11:02:50 am »
Im more than likely hindering rather than helping i must admit ive never used Kawaks or played much of the KOF games
but from what your saying the game your trying to add works but when you perform a special move the game crashes
i still think your missing some code somewhere maybe decryption or encryption that the game triggers when you perform
the Iori's DM special moves

Anyway best of luck i hope you get it sorted
« Last Edit: June 25, 2014, 03:07:08 pm by gamez fan »

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.148
« Reply #18 on: June 25, 2014, 11:21:05 pm »
I not sure that Winkawaks (using a loader) load only decripted roms, but probably yes... and MAME always runs decrypted bootlegs without decryption codes so far at least

Offline Robert

  • MAME Devs
  • *****
  • Posts: 387
  • Karma: +27/-0
    • The MESSUI Place
Re: Error inserting a neogeo game in MAME 0.148
« Reply #19 on: June 26, 2014, 08:28:38 am »
If all the roms are already decrypted, the driver_init will be 'neogeo'. But if some need decrypting, which ones are they?


I don't have the sets you're talking about, but I just added kof2k2mp3 (Magic Plus III) to my emu, all the roms are decrypted and it appears to work fine. I found some sets though that start ok, but crash while the demo fight is going. These are buggy imo. You might have one that contains bugs.
« Last Edit: June 26, 2014, 08:34:36 am by Robert »

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.148
« Reply #20 on: June 26, 2014, 02:58:56 pm »
Magic Plus III works fine here too :(

if you want i upload these roms...

and, Robert... that's games runs fine in kawaks, without any bugs...
« Last Edit: June 26, 2014, 03:20:57 pm by SeiferAlmasy »

Offline Robert

  • MAME Devs
  • *****
  • Posts: 387
  • Karma: +27/-0
    • The MESSUI Place
Re: Error inserting a neogeo game in MAME 0.148
« Reply #21 on: June 26, 2014, 05:10:55 pm »
I notice that Kawaks and others have different address alignments to MAME, so a game that works fine in Kawaks can cause a 68000 exception in MAME. I had that problem the other day when I added the demo 'knackiballs'. Being a simple demo I was able to patch it to make it work. However if that is the problem, you are unlikely to be able to patch such a large game as kof2002.

As for the other matter, we should use the PM system.

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.148
« Reply #22 on: June 26, 2014, 10:13:01 pm »
All build of mame that support this game are the same error ... I do not know if you can help it, if you are interested or something ... but if you can, I am sending you a private message so

Offline Robert

  • MAME Devs
  • *****
  • Posts: 387
  • Karma: +27/-0
    • The MESSUI Place
Re: Error inserting a neogeo game in MAME 0.148
« Reply #23 on: June 27, 2014, 05:49:04 am »
Answered your PM. I'll be away for a few days on a short holiday.

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.148
« Reply #24 on: June 27, 2014, 12:59:56 pm »
Thanks Robert...

Meanwhile'm studying the source code (updated to current version, 0153) and seeing if I can solve here...

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.153 (Updated source from 148)
« Reply #25 on: June 27, 2014, 05:44:48 pm »
my driver now

neogeo.h

Code: [Select]
DECLARE_DRIVER_INIT(kf2k2mp3);
neogeo.c

Code: [Select]
ROM_START( kf2k2mp3 )
ROM_REGION( 0x500000, "maincpu", 0 )
ROM_LOAD16_WORD_SWAP( "kf2k2mp3-p1.rom", 0x000000, 0x100000, CRC(0cdbe99c) SHA1(d1c0c953a1c313d10105a7882dadd5927bCA3E4F) )
ROM_LOAD16_WORD_SWAP( "kf2k2mp3-p2.rom", 0x100000, 0x400000, CRC(de6ffd21) SHA1(0f9108aae7541d0d754ce764b195c921c021c373) )

NEO_SFIX_128K( "kf2k2mp3-s1.rom", CRC(4d0c4e77) SHA1(6e65b3e0ec2a04de4553f8ccf9c3197a0126e332) )

/* Encrypted */
NEO_BIOS_AUDIO_ENCRYPTED_128K( "265-m1.m1", CRC(85aaa632) SHA1(744fba4ca3bc3a5873838af886efb97a8a316104) ) /* mask rom TC531001 */

ROM_REGION( 0x1000000, "ymsnd", 0 )
/* Encrypted */
ROM_LOAD( "265-v1.v1", 0x000000, 0x800000, CRC(15e8f3f5) SHA1(7c9e6426b9fa6db0158baa17a6485ffce057d889) ) /* mask rom TC5364205 */
ROM_LOAD( "265-v2.v2", 0x800000, 0x800000, CRC(da41d6f9) SHA1(a43021f1e58947dcbe3c8ca5283b20b649f0409d) ) /* mask rom TC5364205 */

NO_DELTAT_REGION

ROM_REGION( 0x4000000, "sprites", 0 )
/* NOT Encrypted */
ROM_LOAD16_BYTE( "kf2k2_c1.rom", 0x0000000, 0x800000, CRC(c1a21b4c) SHA1(235938175d6011c5c8a37fc94f8fb604132d8038) ) /* Plane 0,1 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c2.rom", 0x0000001, 0x800000, CRC(9b3d7e8d) SHA1(38c16541862636934a456f23632f64ff0f5ae617) ) /* Plane 2,3 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c3.rom", 0x1000000, 0x800000, CRC(e5074eea) SHA1(387ef21d58b416126b95843bac1a0b6cc346818f) ) /* Plane 0,1 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c4.rom", 0x1000001, 0x800000, CRC(f6eb1ff2) SHA1(77cb493b9e75d42c204a9a6c052a813c2730e44f) ) /* Plane 2,3 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c5.rom", 0x2000000, 0x800000, CRC(74bba7c6) SHA1(e01adc7a4633bc0951b9b4f09abc07d728e9a2d9) ) /* Plane 0,1 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c6.rom", 0x2000001, 0x800000, CRC(e20d2216) SHA1(5d28eea7b581e780b78f391a8179f1678ee0d9a5) ) /* Plane 2,3 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c7.rom", 0x3000000, 0x800000, CRC(0e9f6adb) SHA1(0e4cdbd3df2ef7b0c78c3275ee22684c67bf2d23) ) /* Plane 0,1 */ /* mask rom TC5364205 */
ROM_LOAD16_BYTE( "kf2k2_c8.rom", 0x3000001, 0x800000, CRC(9961799e) SHA1(cf5d43bbd90269155ac41fe9a31328654784351f) ) /* Plane 2,3 */ /* mask rom TC5364205 */
ROM_END

PS: M1 and V's roms are encrypted (from kof2002 - kf2k2mp3 is "parent" in my compilation, C5 and C6 orinally from kof2k2nd fully decryted)

Code: [Select]
DRIVER_INIT_MEMBER(neogeo_state,kf2k2mp3)
{
DRIVER_INIT_CALL(neogeo);
neo_pcm2_swap(0);
neogeo_cmc50_m1_decrypt();
}

Code: [Select]
GAME( 2002, kf2k2mp3,   kof2002,  neogeo,   neogeo, neogeo_state,   kf2k2mp3, ROT0, "bootleg", "The King of Fighters 2002 Magic Plus III (bootleg)" , GAME_SUPPORTS_SAVE ) /* Non Encrypted P's - Encrypted M and V's - Non-Encrypted GFX */
But the error continues...

PS: I posted this to reference only... this actual source

Maybe this help...





« Last Edit: June 27, 2014, 11:18:08 pm by SeiferAlmasy »

Offline Robert

  • MAME Devs
  • *****
  • Posts: 387
  • Karma: +27/-0
    • The MESSUI Place
Re: Error inserting a neogeo game in MAME 0.153 (Updated source from 148)
« Reply #26 on: June 30, 2014, 02:55:13 am »
I added kof2k2js to HBMAME and it worked. I'm no gamer so cannot comment on a particular move. Perhaps it still crashes where you said, but I have no way to get to that point. All I can do is make sure it looks ok in attract mode.

I did notice that the set is almost identical to kof2k2rm13, so perhaps you could try that one instead.

EDIT: Looking at your screenshots I can see it complaining about address misalignment. It says A6=C9A2C9A5 which is an odd number. You can only write to even addresses (unless in byte mode). That's why it has stopped. Kawaks and some others will let you break the rules, which is why the game works on them. It is unfortunate that so many neogeo hackers use KawaksPlus and other hacked emulators for their development.
« Last Edit: June 30, 2014, 03:04:13 am by Robert »

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.153 (Updated source from 148)
« Reply #27 on: July 01, 2014, 02:08:23 am »
in the HBMAME same error occurs... but the kof2k2rm13 in isn't famous hack, i find it in a arabian site only but the link is offline

this kof2k2rm13 is part of HBMAME?

EDIT: i add kof2k2js but same error, kof2k2rm13 (Remix Ultra 2.5 or 3.0 i think) is diff from kof2k2js (Remix Ultra 3.5) but same error on both roms in Iori DM move...

My hope was that this build of MAME (HBMAME) the game did not have the same error, but it does.

I downloaded many builds of MAME that support this game in various ZIPs, but with the same CRC files, insert the source code of several others, but the error persists

I give up, I do not even know how to fix this, if it's hopeless ...

Thanks for the help Robert, and everyone who tried to help
« Last Edit: July 01, 2014, 03:12:48 am by SeiferAlmasy »

Offline Robert

  • MAME Devs
  • *****
  • Posts: 387
  • Karma: +27/-0
    • The MESSUI Place
Re: Error inserting a neogeo game in MAME 0.153 (Updated source from 148)
« Reply #28 on: July 01, 2014, 06:03:39 am »
kof2k2rm13 is also known as kf2k2rm13 and you should have no difficulty finding it. The source even says where.

I have no idea what an Iori DM move is..   anyway it appears the hacker made sure it only works in Kawaks.

Offline SeiferAlmasy

  • Newbies
  • *
  • Posts: 44
  • Karma: +1/-0
  • MAME's FAN (Since 1997)
    • vgBR - Videogames Brasil
Re: Error inserting a neogeo game in MAME 0.153 (Updated source from 148)
« Reply #29 on: July 01, 2014, 12:33:24 pm »
Kawaks, Nebula, Final Burn Alpha too i think

I'll use nebula or FBA to this game in my arcade, and voila, I'm done: P (kawaks don't accept command line since 138)

Iori DM (Desperation Move) is a special move, like a SUPER in Street Fighter games

about this address error... i think the game try to READ in A2C9A2 and A2C9A4 and WRITE in A2C9A5 and this causes de error and freezes (or reset system without unibios) have a method to fix this or any hack in code to fix... like as CPS1 video hacks...

Robert, HBMAME is yours? that's a great emulator (PLEASE FIX THIS LOL - just kidding :p)

PS: i don't give up... :p
« Last Edit: July 01, 2014, 03:10:43 pm by SeiferAlmasy »