Author Topic: Graphics GLitches in Neo Geo Games...  (Read 3437 times)

Offline CyborgSuperman

  • Newbies
  • *
  • Posts: 2
  • Karma: +0/-0
Graphics GLitches in Neo Geo Games...
« on: December 12, 2005, 12:29:05 AM »
I recently incorporated [Raw]Men Mame's source changes into my own plain, non-32 compile of mame and now all neogeo games EXCEPT for the bootlegs have missing life bars, insert coin text, player texts, etc. yet all the graphics are intact.  I know it says that some of these changes may not work on normal mame, but I'd like to know what changes to make in order to have all the texts and such return to the games on plain old mame (102u3).  Here's the readme for the source changes.
Changes for [RAW]men 102u3:
-Cleaned up code.

Changes for [RAW]men 102u2:
-Removed zintrkcd, kf2k1pla, ct2k3sp, kof2k2mp.
-Added kog, lans2004, kf10thep, kof2km2.
-Changed kof10thu to kf2k5uni.
-Changed kof10th code (it actually did work properly...just don't play in console training mode).

Changes for [RAW]men 100u2:
-Added Kof2k2mp, Kof10thu.
-Changed decrypted m1 in Samsho5, Samsho5h.
-Removed kf2k2pls.

Note: Remember, these source changes are applied to a Mame32 Plus! source. Some games will not work if applied to regular MAME source.

-------------------------------------
put this at the end of the Rom start/end section
-------------------------------------
Code: [Select]
ROM_START( kog ) /* Kof97 Hack */
ROM_REGION( 0x600000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "kog_p1.rom", 0x000000, 0x200000, CRC(d2413ec6) SHA1(c0bf409d1e714cba5fdc6f79e4c2aec805316634) )
ROM_LOAD16_WORD_SWAP( "232-p2.bin", 0x200000, 0x400000, CRC(158b23f6) SHA1(9744620a70513490aaf9c5eda33e5ec31222be19) )

NEO_SFIX_128K( "kog_s1.rom", CRC(0bef69da) SHA1(80918586e694dce35c4dba796eb18abf6a070ebb) )

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

ROM_REGION( 0xc00000, REGION_SOUND1, 0 )
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( "kog_c1a.rom", 0x0000000, 0x800000, CRC(4eab9b0a) SHA1(a6f6b755215a3f41474e0a76b5463303a522c2d3) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kog_c2a.rom", 0x0000001, 0x800000, CRC(697f8fd0) SHA1(5784464c2357ccef8e6e79b6298843fc3d13b39c) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kog_c1b.rom", 0x1000000, 0x800000, CRC(1143fdf3) SHA1(9dc5fe9a3b7599380db62095880e2d6f237a41bd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kog_c2b.rom", 0x1000001, 0x800000, CRC(ea82cf8f) SHA1(3d9ab64b69cecd6b3950839ac2c6d151ad66dcf8) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kog_c3.rom", 0x2000000, 0x400000, CRC(abd1be07) SHA1(857eb68bbee4538770bbfa77aaa540d61ab0abcd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kog_c4.rom", 0x2000001, 0x400000, CRC(d2bd967b) SHA1(c494e0a98e127d37ca360a28accc167fa50fb626) ) /* Plane 2,3 */
ROM_END

ROM_START( lans2004 ) /* ShockTr2 Hack */
ROM_REGION( 0x600000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "lnsq-p1.bin",  0x000000, 0x200000, CRC(b40a879a) SHA1(379f3d44b0bae430b32157fd5f4018d77b243c58) )
ROM_LOAD16_WORD_SWAP( "lnsq-p21.bin", 0x200000, 0x200000, CRC(ecdb2d42) SHA1(0d930cd369dfbcab7778b144355e5f70874aa324) )
ROM_LOAD16_WORD_SWAP( "lnsq-p22.bin", 0x400000, 0x200000, CRC(fac5e2e7) SHA1(5cce7226c137da80c969df00e1cda41ef9c5082c) )

NEO_SFIX_128K( "lnsq-s1.bin", CRC(39e82897) SHA1(24a8c94dd7e70ecde8f90ea17f75b6b5d065704f) )

NEO_BIOS_SOUND_128K( "246-m1.bin", CRC(d0604ad1) SHA1(fae3cd52a177eadd5f5775ace957cc0f8301e65d) )

ROM_REGION( 0xA00000, REGION_SOUND1, 0 )
ROM_LOAD( "lnsq-v1.bin", 0x000000, 0x400000, CRC(4408ebc3) SHA1(e3f4d8a7e243a8cf48e97d91bbfec7829c0d9404) )
ROM_LOAD( "lnsq-v2.bin", 0x400000, 0x400000, CRC(3d953975) SHA1(6a4ab02ab3d4416a65343cf16815007cb273f19b) )
ROM_LOAD( "lnsq-v3.bin", 0x800000, 0x200000, CRC(437d1d8e) SHA1(95e015c21707b53ed7223eaa19f6cdcfb4d94f0c) )

NO_DELTAT_REGION

ROM_REGION( 0x3000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "lnsq-c1.bin", 0x0000000, 0x800000, CRC(b83de59f) SHA1(8cc060f9a57ab7d4238543b0bce5f5cd1d271d4f) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "lnsq-c2.bin", 0x0000001, 0x800000, CRC(e08969fd) SHA1(c192639d023cdad64a8f53dbcda02aa8cfb4168e) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "lnsq-c3.bin", 0x1000000, 0x800000, CRC(013f2cda) SHA1(6261111ce69dc23fbf97241131e5a6a49355d18c) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "lnsq-c4.bin", 0x1000001, 0x800000, CRC(d8c3a758) SHA1(d19ca3be06f9fb0cb1933b1eb3da318524c3145d) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "lnsq-c5.bin", 0x2000000, 0x800000, CRC(75500b82) SHA1(06d2afe94ea3eb3c4e523f593b8e709dd7c284a3) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "lnsq-c6.bin", 0x2000001, 0x800000, CRC(670ac13b) SHA1(f448a144caae51b69ea19e1f43940db135d1164a) ) /* Plane 2,3 */
ROM_END

ROM_START( cthd2003 ) /* Kof2001 Hack */
ROM_REGION( 0x500000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "5003-p1.bin", 0x000000, 0x100000, CRC(bb7602c1) SHA1(abf329a40f34c88f7325b255e3bc090db1edaca4) )
ROM_LOAD16_WORD_SWAP( "5003-p2.bin", 0x100000, 0x400000, CRC(adc1c22b) SHA1(271e0629989257a0d21d280c05df53df259414b1) )

NEO_SFIX_128K( "5003-s1.bin", CRC(5ba29aab) SHA1(e7ea67268a10243693bff722e6fd2276ca540acf) )

NEO_BIOS_SOUND_128K( "5003-m1.bin", CRC(1a8c274b) SHA1(5f6f9c533f4a296a18c741ce59a69cf6f5c836b9) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "262-v1.bin", 0x000000, 0x400000, CRC(83d49ecf) SHA1(2f2c116e45397652e77fcf5d951fa5f71b639572) )
ROM_LOAD( "262-v2.bin", 0x400000, 0x400000, CRC(003f1843) SHA1(bdd58837ad542548bd4053c262f558af88e3b989) )
ROM_LOAD( "262-v3.bin", 0x800000, 0x400000, CRC(2ae38dbe) SHA1(4e82b7dd3b899d61907620517a5a27bdaba0725d) )
ROM_LOAD( "262-v4.bin", 0xc00000, 0x400000, CRC(26ec4dd9) SHA1(8bd68d95a2d913be41a51f51e48dbe3bff5924fb) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "5003-c1.bin", 0x0000000, 0x800000, CRC(68f54b67) SHA1(e2869709b11ea2846799fe431211c83e928e103e) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "5003-c2.bin", 0x0000001, 0x800000, CRC(2f8849d5) SHA1(7ef74981aa056f5acab4ddabffd3e98b4cb970be) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "5003-c3.bin", 0x1000000, 0x800000, CRC(ac4aff71) SHA1(c983f642e68deaa40fee3e208f2dd55f3bacbdc1) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "5003-c4.bin", 0x1000001, 0x800000, CRC(afef5d66) SHA1(39fe785563fbea54bba88de60dcc62e2458bd74a) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "5003-c5.bin", 0x2000000, 0x800000, CRC(c7c1ae50) SHA1(f54f5be7513a5ce2f01ab107a2b26f6a9ee1f2a9) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "5003-c6.bin", 0x2000001, 0x800000, CRC(613197f9) SHA1(6d1fefa1be81b79e251e55a1352544c0298e4674) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "5003-c7.bin", 0x3000000, 0x800000, CRC(64ddfe0f) SHA1(361f3f4618009bf6419961266eb9ab5002bef53c) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "5003-c8.bin", 0x3000001, 0x800000, CRC(917a1439) SHA1(6f28d1d7c6edee1283f25e632c69204dbebe40af) ) /* Plane 2,3 */
ROM_END

ROM_START( kf2k4spe ) /* Kof2002 Hack */
ROM_REGION( 0x500000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "k2k4s-p1.bin", 0x100000, 0x400000, CRC(e6c50566) SHA1(cc6a3489a3bfeb4dcc65b6ddae0030f7e66fbabe) )
ROM_LOAD16_WORD_SWAP( "k2k4s-p2.bin", 0x000000, 0x080000, CRC(21a84084) SHA1(973e8a0bffa0e1f055803f663f81a8e03701802d) )
ROM_LOAD16_WORD_SWAP( "k2k4s-p3.bin", 0x080000, 0x080000, CRC(febb484e) SHA1(4b1838795b84f22d578ad043641df0a7bf7d9774) )

NEO_SFIX_128K( "k2k4s-s1.bin", CRC(a3c9b2d8) SHA1(1472d2cbd7bb73e84824ecf773924007e6117e77) )

NEO_BIOS_SOUND_128K( "k2k4s-m1.bin", CRC(5a47d9ad) SHA1(0197737934653acc6c97221660d789e9914f3578) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "265-v1.bin", 0x000000, 0x800000, CRC(15e8f3f5) SHA1(7c9e6426b9fa6db0158baa17a6485ffce057d889) )
ROM_LOAD( "265-v2.bin", 0x800000, 0x800000, CRC(da41d6f9) SHA1(a43021f1e58947dcbe3c8ca5283b20b649f0409d) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "k2k4s-c4.bin", 0x0000000, 0x800000, CRC(7a050288) SHA1(55a20c5b01e11a859f096af3f8e09986025d288f) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "k2k4s-c8.bin", 0x0000001, 0x800000, CRC(e924afcf) SHA1(651e974f7339d2cdcfa58c5398013197a0525b77) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "k2k4s-c3.bin", 0x1000000, 0x800000, CRC(959fad0b) SHA1(63ab83ddc5f688dc8165a7ff8d262df3fcd942a2) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "k2k4s-c7.bin", 0x1000001, 0x800000, CRC(efe6a468) SHA1(2a414285e48aa948b5b0d4a9333bab083b5fb853) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "k2k4s-c2.bin", 0x2000000, 0x800000, CRC(74bba7c6) SHA1(e01adc7a4633bc0951b9b4f09abc07d728e9a2d9) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "k2k4s-c6.bin", 0x2000001, 0x800000, CRC(e20d2216) SHA1(5d28eea7b581e780b78f391a8179f1678ee0d9a5) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "k2k4s-c1.bin", 0x3000000, 0x800000, CRC(fa705b2b) SHA1(f314c66876589601806352484dd8e45bc41be692) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "k2k4s-c5.bin", 0x3000001, 0x800000, CRC(2c912ff9) SHA1(b624a625ea3e221808b7ea43fb0b1a51d8c1853e) ) /* Plane 2,3 */
ROM_END

ROM_START( kof10th ) /* Kof2002 Hack */
ROM_REGION( 0x900000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "kf10-p1.bin", 0x000000, 0x800000, CRC(b1fd0c43) SHA1(5f842a8a27be2d957fd4140d6431ae47154997bb) )

ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_FILL(              0x000000, 0x20000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

NEO_BIOS_SOUND_128K( "kf10-m1.bin", CRC(f6fab859) SHA1(0184aa1394b9f9946d610278b53b846020dd88dc) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "kf10-v1.bin", 0x000000, 0x800000, CRC(0fc9a58d) SHA1(9d79ef00e2c2abd9f29af5521c2fbe5798bf336f) )
ROM_LOAD( "kf10-v2.bin", 0x800000, 0x800000, CRC(b8c475a4) SHA1(10caf9c69927a223445d2c4b147864c02ce520a8) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "kf10-c1a.bin", 0x0000000, 0x400000, CRC(3bbc0364) SHA1(e8aa7ff82f151ce1db56f259377b64cceef85af0) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c2a.bin", 0x0000001, 0x400000, CRC(91230075) SHA1(d9098e05a7ba6008661147b6bf8bc2f494b8b72b) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c1b.bin", 0x0800000, 0x400000, CRC(b5abfc28) SHA1(eabf60992bb3485c95330065294071ec155bfe7c) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c2b.bin", 0x0800001, 0x400000, CRC(6cc4c6e1) SHA1(be824a944e745ee18efdc45c81fd496a4d624b9c) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c3a.bin", 0x1000000, 0x400000, CRC(5b3d4a16) SHA1(93ac1cd7739100f8c32732644f81f2a19837b131) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c4a.bin", 0x1000001, 0x400000, CRC(c6f3419b) SHA1(340c17a73aeb7bf8a6209f8459e6f00000075b50) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c3b.bin", 0x1800000, 0x400000, CRC(9d2bba19) SHA1(5ebbd0af3f83a60e33c8ccb743e3d5f5a96f1273) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c4b.bin", 0x1800001, 0x400000, CRC(5a4050cb) SHA1(8fd2291f349efa1ed5cd37ad4e273b60fe831a77) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c5a.bin", 0x2000000, 0x400000, CRC(a289d1e1) SHA1(50c7d7ebde6e118a01036cc3e40827fcd9f0d3fd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c6a.bin", 0x2000001, 0x400000, CRC(e6494b5d) SHA1(18e064b9867ae0b0794065f8dbefd486620419db) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c5b.bin", 0x2800000, 0x400000, CRC(404fff02) SHA1(56d1b32c87ea4885e49264e8b21846e465a20e1f) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c6b.bin", 0x2800001, 0x400000, CRC(f2ccfc9e) SHA1(69db7fac7023785ab94ea711a72dbc2826cfe1a3) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c7a.bin", 0x3000000, 0x400000, CRC(be79c5a8) SHA1(ded3c5eb3571647f50533eb682c2675372ace3fb) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c8a.bin", 0x3000001, 0x400000, CRC(a5952ca4) SHA1(76dbb3cb45ce5a4beffa1ed29491204fc6617e42) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c7b.bin", 0x3800000, 0x400000, CRC(3fdb3542) SHA1(7d2050752a2064cd6729f483a0da93808e2c6033) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c8b.bin", 0x3800001, 0x400000, CRC(661b7a52) SHA1(0ae2ad2389134892f156337332b77adade3ddad1) ) /* Plane 2,3 */
ROM_END

ROM_START( kf10thep ) /* Kof2002 Hack */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "5008_p1.rom", 0x000000, 0x200000, CRC(bf5469ba) SHA1(f05236d8fffab5836c0d27becdeeb80def32ee49) )
ROM_LOAD16_WORD_SWAP( "5008_p2.rom", 0x200000, 0x400000, CRC(a649ec38) SHA1(5c63ed5e5c848940f587c966da4908d04cf1293c) )
ROM_LOAD16_WORD_SWAP( "5008_p3.rom", 0x600000, 0x200000, CRC(e629e13c) SHA1(6ebe080ce01c51064cb2f4d89315ba98a45ae727) )

NEO_SFIX_128K( "5008_s1.rom", CRC(92410064) SHA1(1fb800b46341858207d3b6961a760289fbec7faa) )

NEO_BIOS_SOUND_128K( "5008_m1.rom", CRC(5a47d9ad) SHA1(0197737934653acc6c97221660d789e9914f3578) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "kf10-v1.bin", 0x000000, 0x800000, CRC(0fc9a58d) SHA1(9d79ef00e2c2abd9f29af5521c2fbe5798bf336f) )
ROM_LOAD( "kf10-v2.bin", 0x800000, 0x800000, CRC(b8c475a4) SHA1(10caf9c69927a223445d2c4b147864c02ce520a8) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "kf10-c1a.bin", 0x0000000, 0x400000, CRC(3bbc0364) SHA1(e8aa7ff82f151ce1db56f259377b64cceef85af0) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c2a.bin", 0x0000001, 0x400000, CRC(91230075) SHA1(d9098e05a7ba6008661147b6bf8bc2f494b8b72b) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c1b.bin", 0x0800000, 0x400000, CRC(b5abfc28) SHA1(eabf60992bb3485c95330065294071ec155bfe7c) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c2b.bin", 0x0800001, 0x400000, CRC(6cc4c6e1) SHA1(be824a944e745ee18efdc45c81fd496a4d624b9c) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c3a.bin", 0x1000000, 0x400000, CRC(5b3d4a16) SHA1(93ac1cd7739100f8c32732644f81f2a19837b131) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c4a.bin", 0x1000001, 0x400000, CRC(c6f3419b) SHA1(340c17a73aeb7bf8a6209f8459e6f00000075b50) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c3b.bin", 0x1800000, 0x400000, CRC(9d2bba19) SHA1(5ebbd0af3f83a60e33c8ccb743e3d5f5a96f1273) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c4b.bin", 0x1800001, 0x400000, CRC(5a4050cb) SHA1(8fd2291f349efa1ed5cd37ad4e273b60fe831a77) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c5a.bin", 0x2000000, 0x400000, CRC(a289d1e1) SHA1(50c7d7ebde6e118a01036cc3e40827fcd9f0d3fd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c6a.bin", 0x2000001, 0x400000, CRC(e6494b5d) SHA1(18e064b9867ae0b0794065f8dbefd486620419db) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c5b.bin", 0x2800000, 0x400000, CRC(404fff02) SHA1(56d1b32c87ea4885e49264e8b21846e465a20e1f) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c6b.bin", 0x2800001, 0x400000, CRC(f2ccfc9e) SHA1(69db7fac7023785ab94ea711a72dbc2826cfe1a3) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c7a.bin", 0x3000000, 0x400000, CRC(be79c5a8) SHA1(ded3c5eb3571647f50533eb682c2675372ace3fb) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c8a.bin", 0x3000001, 0x400000, CRC(a5952ca4) SHA1(76dbb3cb45ce5a4beffa1ed29491204fc6617e42) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "5008_c7b.rom", 0x3800000, 0x400000, CRC(33604ef0) SHA1(57deec23c81d5d673ce5992cef1f2567f1a2148e) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "5008_c8b.rom", 0x3800001, 0x400000, CRC(51f6a8f8) SHA1(9ef1cdbdd125a2b430346c22b59f36902312905f) ) /* Plane 2,3 */
ROM_END

ROM_START( kf2k5uni ) /* Kof2002 Hack */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "5006-p2a.bin", 0x000000, 0x400000, CRC(ced883a2) SHA1(f93db4d74ce0a73a3e9631966fee37be22470c89) )
ROM_LOAD16_WORD_SWAP( "5006-p1.bin", 0x400000, 0x400000, CRC(72c39c46) SHA1(4ba0657de20319c0bc30c7c3bba7d7331d0ce9a7) )

NEO_SFIX_128K( "5006-s1.bin", CRC(91f8c544) SHA1(9d16cafb9ca4bc54f31f7fd82b1be06ec8b11c79) )

NEO_BIOS_SOUND_128K( "5006-m1.bin", CRC(9050bfe7) SHA1(765bf3d954f775231b7ef2504bb844cd0b29e3f7) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "kf10-v1.bin", 0x000000, 0x800000, CRC(0fc9a58d) SHA1(9d79ef00e2c2abd9f29af5521c2fbe5798bf336f) )
ROM_LOAD( "kf10-v2.bin", 0x800000, 0x800000, CRC(b8c475a4) SHA1(10caf9c69927a223445d2c4b147864c02ce520a8) )

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "kf10-c1a.bin", 0x0000000, 0x400000, CRC(3bbc0364) SHA1(e8aa7ff82f151ce1db56f259377b64cceef85af0) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c2a.bin", 0x0000001, 0x400000, CRC(91230075) SHA1(d9098e05a7ba6008661147b6bf8bc2f494b8b72b) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c1b.bin", 0x0800000, 0x400000, CRC(b5abfc28) SHA1(eabf60992bb3485c95330065294071ec155bfe7c) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c2b.bin", 0x0800001, 0x400000, CRC(6cc4c6e1) SHA1(be824a944e745ee18efdc45c81fd496a4d624b9c) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c3a.bin", 0x1000000, 0x400000, CRC(5b3d4a16) SHA1(93ac1cd7739100f8c32732644f81f2a19837b131) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c4a.bin", 0x1000001, 0x400000, CRC(c6f3419b) SHA1(340c17a73aeb7bf8a6209f8459e6f00000075b50) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c3b.bin", 0x1800000, 0x400000, CRC(9d2bba19) SHA1(5ebbd0af3f83a60e33c8ccb743e3d5f5a96f1273) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c4b.bin", 0x1800001, 0x400000, CRC(5a4050cb) SHA1(8fd2291f349efa1ed5cd37ad4e273b60fe831a77) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c5a.bin", 0x2000000, 0x400000, CRC(a289d1e1) SHA1(50c7d7ebde6e118a01036cc3e40827fcd9f0d3fd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c6a.bin", 0x2000001, 0x400000, CRC(e6494b5d) SHA1(18e064b9867ae0b0794065f8dbefd486620419db) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c5b.bin", 0x2800000, 0x400000, CRC(404fff02) SHA1(56d1b32c87ea4885e49264e8b21846e465a20e1f) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c6b.bin", 0x2800001, 0x400000, CRC(f2ccfc9e) SHA1(69db7fac7023785ab94ea711a72dbc2826cfe1a3) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c7a.bin", 0x3000000, 0x400000, CRC(be79c5a8) SHA1(ded3c5eb3571647f50533eb682c2675372ace3fb) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c8a.bin", 0x3000001, 0x400000, CRC(a5952ca4) SHA1(76dbb3cb45ce5a4beffa1ed29491204fc6617e42) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "kf10-c7b.bin", 0x3800000, 0x400000, CRC(3fdb3542) SHA1(7d2050752a2064cd6729f483a0da93808e2c6033) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "kf10-c8b.bin", 0x3800001, 0x400000, CRC(661b7a52) SHA1(0ae2ad2389134892f156337332b77adade3ddad1) ) /* Plane 2,3 */
ROM_END

ROM_START( kof2km2 ) /* Kof2002 Hack */
ROM_REGION( 0x600000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "k2k2m2p1.bin", 0x000000, 0x200000, CRC(1016806c) SHA1(a583b45e9c0d6f67b95c52e44444aabe88f68d97) )
ROM_LOAD16_WORD_SWAP( "k2k2m2p2.bin", 0x200000, 0x400000, CRC(432fdf53) SHA1(d7e542cd84d948162c60768e40ee4ed33d8e7913) )

NEO_SFIX_128K( "k2k2m2s1.bin", CRC(446e74c5) SHA1(efc2afb26578bad9eb21659c70eb0f827d6d1ef6) )

NEO_BIOS_SOUND_128K( "265-m1_decrypted.bin", CRC(1c661a4b) SHA1(4e5aa862a0a182a806d538996ddc68d9f2dffaf7) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "265-v1.bin", 0x000000, 0x800000, CRC(15e8f3f5) SHA1(7c9e6426b9fa6db0158baa17a6485ffce057d889) )
ROM_LOAD( "265-v2.bin", 0x800000, 0x800000, CRC(da41d6f9) SHA1(a43021f1e58947dcbe3c8ca5283b20b649f0409d) )

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "265-c1.bin", 0x0000000, 0x800000, CRC(2b65a656) SHA1(9c46d8cf5b1ef322db442ac6a9b9406ab49206c5) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "265-c2.bin", 0x0000001, 0x800000, CRC(adf18983) SHA1(150cd4a5e51e9df88688469d2ea7675c2cf3658a) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "265-c3.bin", 0x1000000, 0x800000, CRC(875e9fd7) SHA1(28f52d56192d48bbc5dc3c97abf456bd34a58cbd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "265-c4.bin", 0x1000001, 0x800000, CRC(2da13947) SHA1(f8d79ec2c236aa3d3648a4f715676899602122c1) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "265-c5.bin", 0x2000000, 0x800000, CRC(61bd165d) SHA1(b3424db84bc683d858fb635bc42728f9cdd89caf) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "265-c6.bin", 0x2000001, 0x800000, CRC(03fdd1eb) SHA1(6155c7e802062f4eafa27e414c4e73ee59b868bf) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "265-c7.bin", 0x3000000, 0x800000, CRC(1a2749d8) SHA1(af7d9ec1d576209826fa568f676bbff92f6d6ddd) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "265-c8.bin", 0x3000001, 0x800000, CRC(ab0bb549) SHA1(d23afb60b7f831f7d4a98ad3c4a00ee19877a1ce) ) /* Plane 2,3 */
ROM_END

ROM_START( pnyaa ) /* Encrypted Set */
ROM_REGION( 0x100000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "267-p1.bin", 0x000000, 0x100000, CRC(112fe2c0) SHA1(01420e051f0bdbd4f68ce306a3738161b96f8ba8) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_FILL( 0x000000, 0x20000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "267-m1.bin", 0x00000, 0x80000, CRC(c7853ccd) SHA1(1b7a4c5093cf0fe3861ce44fd1d3b30c71ad0abe) )
/* Decrypted */
NEO_BIOS_SOUND_512K( "267-m1_decrypted.bin", CRC(d58eaa8e) SHA1(4c4faf1da671a41b4d854790eb623a40cb35f256) )

ROM_REGION( 0x400000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "267-v1.bin", 0x000000, 0x400000, CRC(e2e8e917) SHA1(7f412d55aebff3d38a225a88c632916295ab0584) )

NO_DELTAT_REGION

ROM_REGION( 0x1000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "267-c1.bin", 0x0000000, 0x800000, CRC(2e20617a) SHA1(ed73724377a321aa024a5886eb148c416d4451aa) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "267-c2.bin", 0x0000001, 0x800000, CRC(4edfa720) SHA1(1407a1d0d44f73c1a196c95d368d6451b17f6176) ) /* Plane 2,3 */
ROM_END

ROM_START( mslug5 ) /* Encrypted Set */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD32_WORD_SWAP( "268-p1cr.bin", 0x000000, 0x400000, CRC(d0466792) SHA1(880819933d997fab398f91061e9dbccb959ae8a1) )
ROM_LOAD32_WORD_SWAP( "268-p2cr.bin", 0x000002, 0x400000, CRC(fbf6b61e) SHA1(9ec743d5988b5e3183f37f8edf45c72a8c0c893e) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_FILL( 0x000000, 0x20000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "268-m1.bin", 0x00000, 0x40000, NO_DUMP )
/* Decrypted */
NEO_BIOS_SOUND_512K( "268-m1_decrypted.bin", CRC(2f621a2b) SHA1(e88f645b4935157608c32843f203180c796f5304) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "268-v1c.bin", 0x000000, 0x800000, CRC(ae31d60c) SHA1(c42285cf4e52fea74247860813e826df5aa7600a) )
ROM_LOAD( "268-v2c.bin", 0x800000, 0x800000, CRC(c40613ed) SHA1(af889570304e2867d7dfea1e94e388c06249fb67) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "268-c1c.bin", 0x0000000, 0x800000, CRC(ab7c389a) SHA1(025a188de589500bf7637fa8e7a37ab24bf4312e) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c2c.bin", 0x0000001, 0x800000, CRC(3560881b) SHA1(493d218c92290b4770024d6ee2917c4022753b07) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "268-c3c.bin", 0x1000000, 0x800000, CRC(3af955ea) SHA1(cf36b6ae9b0d12744b17cb7a928399214de894be) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c4c.bin", 0x1000001, 0x800000, CRC(c329c373) SHA1(5073d4079958a0ef5426885af2c9e3178f37d5e0) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "268-c5c.bin", 0x2000000, 0x800000, CRC(959c8177) SHA1(889bda7c65d71172e7d89194d1269561888fe789) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c6c.bin", 0x2000001, 0x800000, CRC(010a831b) SHA1(aec140661e3ae35d264df416478ba15188544d91) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "268-c7c.bin", 0x3000000, 0x800000, CRC(6d72a969) SHA1(968dd9a4d1209b770b9b85ea6532fa24d262a262) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */
ROM_END

ROM_START( ms5plus ) /* Mslug5 Hack */
ROM_REGION( 0x500000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "268-p1p.bin", 0x000000, 0x100000, CRC(106b276f) SHA1(0e840df95f3813145e5043573483c7610d2d3e68) )
ROM_LOAD16_WORD_SWAP( "268-p2p.bin", 0x100000, 0x200000, CRC(d6a458e8) SHA1(c0a8bdae06d62859fb6734766ccc190eb2a809a4) )
ROM_LOAD16_WORD_SWAP( "268-p3p.bin", 0x300000, 0x200000, CRC(439ec031) SHA1(f0ad8f9be7d26bc504593c1321bd23c286a221f0) )

NEO_SFIX_128K( "268-s1p.bin", CRC(21e04432) SHA1(10057a2aa487087f7143d1d69fdad978a6bef0f7) )

NEO_BIOS_SOUND_512K( "268-m1_decrypted.bin", CRC(2f621a2b) SHA1(e88f645b4935157608c32843f203180c796f5304) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "268-v1c.bin", 0x000000, 0x800000, CRC(ae31d60c) SHA1(c42285cf4e52fea74247860813e826df5aa7600a) )
ROM_LOAD( "268-v2c.bin", 0x800000, 0x800000, CRC(c40613ed) SHA1(af889570304e2867d7dfea1e94e388c06249fb67) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "268-c1c.bin", 0x0000000, 0x800000, CRC(ab7c389a) SHA1(025a188de589500bf7637fa8e7a37ab24bf4312e) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c2c.bin", 0x0000001, 0x800000, CRC(3560881b) SHA1(493d218c92290b4770024d6ee2917c4022753b07) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "268-c3c.bin", 0x1000000, 0x800000, CRC(3af955ea) SHA1(cf36b6ae9b0d12744b17cb7a928399214de894be) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c4c.bin", 0x1000001, 0x800000, CRC(c329c373) SHA1(5073d4079958a0ef5426885af2c9e3178f37d5e0) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "268-c5c.bin", 0x2000000, 0x800000, CRC(959c8177) SHA1(889bda7c65d71172e7d89194d1269561888fe789) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c6c.bin", 0x2000001, 0x800000, CRC(010a831b) SHA1(aec140661e3ae35d264df416478ba15188544d91) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "268-c7c.bin", 0x3000000, 0x800000, CRC(6d72a969) SHA1(968dd9a4d1209b770b9b85ea6532fa24d262a262) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */
ROM_END

ROM_START( svcchaos ) /* Encrypted Set */
ROM_REGION( 0x2000000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "269-p1.bin", 0x000000, 0x2000000, CRC(432cfdfc) SHA1(19b40d32188a8bace6d2d570c6cf3d2f1e31e379) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x80000, REGION_GFX1, 0 ) /* larger char set */
ROM_FILL( 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
/* Decrypted */
NEO_BIOS_SOUND_512K( "269-m1_decrypted.bin", CRC(b042e390) SHA1(4eaf30a2c690b4bd8b372db581c17f3c4e24947b) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD( "269-c1.bin", 0x0000000, 0x2000000, CRC(1b608f9c) SHA1(4e70ad182da2ca18815bd3936efb04a06ebce01e) ) /* Plane 0,1 */
ROM_LOAD( "269-c2.bin", 0x2000000, 0x2000000, CRC(5a95f294) SHA1(6123cc7b20b494076185d27c2ffea910e124b195) ) /* Plane 0,1 */
ROM_END

ROM_START( svchaosa ) /* Encrypted Set, Alternate Set */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD32_WORD_SWAP( "269-p1a.bin", 0x000000, 0x400000, CRC(38e2005e) SHA1(1b902905916a30969282f1399a756e32ff069097) )
ROM_LOAD32_WORD_SWAP( "269-p2a.bin", 0x000002, 0x400000, CRC(6d13797c) SHA1(3cb71a95cea6b006b44cac0f547df88aec0007b7) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x80000, REGION_GFX1, 0 ) /* larger char set */
ROM_FILL( 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
/* Decrypted */
NEO_BIOS_SOUND_512K( "269-m1_decrypted.bin", CRC(b042e390) SHA1(4eaf30a2c690b4bd8b372db581c17f3c4e24947b) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "269-c1r.bin", 0x0000000, 0x800000, CRC(887b4068) SHA1(227cdcf7a10a415f1e3afe7ae97acc9afc2cc8e1) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "269-c2r.bin", 0x0000001, 0x800000, CRC(4e8903e4) SHA1(31daaa4fd6c23e8f0a8428931c513d97d2eee1bd) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "269-c3r.bin", 0x1000000, 0x800000, CRC(7d9c55b0) SHA1(1f94a948b3e3c31b3ff05518ef525031a3cb2c62) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "269-c4r.bin", 0x1000001, 0x800000, CRC(8acb5bb6) SHA1(2c27d6e309646d7b84da85f78c06e4aaa74e844b) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "269-c5r.bin", 0x2000000, 0x800000, CRC(097a4157) SHA1(54d839f55d27f68c704a94ea3c63c644ffc22ca4) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "269-c6r.bin", 0x2000001, 0x800000, CRC(e19df344) SHA1(20448add53ab25dd3a8f0b681131ad3b9c68acc9) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "269-c7r.bin", 0x3000000, 0x800000, CRC(d8f0340b) SHA1(43114af7557361a8903bb8cf8553f602946a9220) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "269-c8r.bin", 0x3000001, 0x800000, CRC(2570b71b) SHA1(99266e1c2ffcf324793fb5c55325fbc7e6265ac0) ) /* Plane 2,3 */
ROM_END

ROM_START( svcsplsf ) /* Svcchaos Hack, S1 Fix */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "269-p1sp.bin", 0x000000, 0x400000, CRC(2601902f) SHA1(202348a13c6480f7de37a3ee983823838822fc98) )
ROM_LOAD16_WORD_SWAP( "269-p2sp.bin", 0x400000, 0x400000, CRC(0ca13305) SHA1(ac8fbca71b754acbcdd11802161a62ae1cf32d88) )

ROM_REGION( 0x80000, REGION_GFX1, 0 ) /* larger char set */
ROM_LOAD( "269-s1sp.bin", 0x000000, 0x80000, CRC(4bb1a271) SHA1(99143cc3f0cb982c094c53073bd34583f0172f2b) )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

NEO_BIOS_SOUND_512K( "269-m1_decrypted.bin", CRC(b042e390) SHA1(4eaf30a2c690b4bd8b372db581c17f3c4e24947b) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD( "269-c1.bin", 0x0000000, 0x2000000, CRC(1b608f9c) SHA1(4e70ad182da2ca18815bd3936efb04a06ebce01e) ) /* Plane 0,1 */
ROM_LOAD( "269-c2.bin", 0x2000000, 0x2000000, CRC(5a95f294) SHA1(6123cc7b20b494076185d27c2ffea910e124b195) ) /* Plane 0,1 */
ROM_END

ROM_START( samsho5 ) /* Encrypted Set */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "270-p1.bin", 0x000000, 0x400000, CRC(4a2a09e6) SHA1(2644de02cdab8ccc605488a7c76b8c9cd1d5bcb9) )
ROM_LOAD16_WORD_SWAP( "270-p2.bin", 0x400000, 0x400000, CRC(e0c74c85) SHA1(df24a4ee76438e40c2f04a714175a7f85cacdfe0) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x80000, REGION_GFX1, 0 ) /* larger char set */
ROM_FILL( 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "270-m1.bin", 0x00000, 0x80000, NO_DUMP )
/* Decrypted */
NEO_BIOS_SOUND_512K( "270-m1_decrypted.bin", CRC(0ca49586) SHA1(8610918af611d8514678fee1617aa47974b604e6) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "270-v1.bin", 0x000000, 0x800000, CRC(62e434eb) SHA1(1985f5e88f8e866f9683b6cea901aa28c04b80bf) )
ROM_LOAD( "270-v2.bin", 0x800000, 0x800000, CRC(180f3c9a) SHA1(6d7dc2605ead6e78704efa127e7e0dfe621e2c54) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "270-c1.bin", 0x0000000, 0x800000, CRC(14ffffac) SHA1(2ccebfdd0c7907679ae95bf6eca85b8d322441e2) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c2.bin", 0x0000001, 0x800000, CRC(401f7299) SHA1(94e48cdf1682b1250f53c59f3f71d995e928d17b) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "270-c3.bin", 0x1000000, 0x800000, CRC(838f0260) SHA1(d5c8d3c6e7221d04e0b20882a847752e5ba95635) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c4.bin", 0x1000001, 0x800000, CRC(041560a5) SHA1(d165e533699f15b1e079c82f97db3542b3a7dd66) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "270-c5.bin", 0x2000000, 0x800000, CRC(bd30b52d) SHA1(9f8282e684415b4045218cf764ef7d75a70e3240) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c6.bin", 0x2000001, 0x800000, CRC(86a69c70) SHA1(526732cdb408cf680af9da39057bce6a4dfb5e13) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "270-c7.bin", 0x3000000, 0x800000, CRC(d28fbc3c) SHA1(a82a6ba6760fad14d9309f9147cb7d80bd6f70fc) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c8.bin", 0x3000001, 0x800000, CRC(02c530a6) SHA1(7a3fafa6075506c6ef78cc4ec2cb72118ec83cb9) ) /* Plane 2,3 */
ROM_END

ROM_START( samsho5h ) /* Encrypted Set, Alternate Set */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "270-p1c.bin", 0x000000, 0x400000, CRC(bf956089) SHA1(c538289069bf338b9fa7ecc5c9143763dbb776a8) )
ROM_LOAD16_WORD_SWAP( "270-p2c.bin", 0x400000, 0x400000, CRC(943a6b1d) SHA1(12bd02fc197456da6ee86f066086094cef0f4bf9) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x80000, REGION_GFX1, 0 ) /* larger char set */
ROM_FILL( 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "270-m1.bin", 0x00000, 0x80000, NO_DUMP )
/* Decrypted */
NEO_BIOS_SOUND_512K( "270-m1_decrypted.bin", CRC(0ca49586) SHA1(8610918af611d8514678fee1617aa47974b604e6) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "270-v1.bin", 0x000000, 0x800000, CRC(62e434eb) SHA1(1985f5e88f8e866f9683b6cea901aa28c04b80bf) )
ROM_LOAD( "270-v2.bin", 0x800000, 0x800000, CRC(180f3c9a) SHA1(6d7dc2605ead6e78704efa127e7e0dfe621e2c54) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "270-c1.bin", 0x0000000, 0x800000, CRC(14ffffac) SHA1(2ccebfdd0c7907679ae95bf6eca85b8d322441e2) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c2.bin", 0x0000001, 0x800000, CRC(401f7299) SHA1(94e48cdf1682b1250f53c59f3f71d995e928d17b) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "270-c3.bin", 0x1000000, 0x800000, CRC(838f0260) SHA1(d5c8d3c6e7221d04e0b20882a847752e5ba95635) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c4.bin", 0x1000001, 0x800000, CRC(041560a5) SHA1(d165e533699f15b1e079c82f97db3542b3a7dd66) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "270-c5.bin", 0x2000000, 0x800000, CRC(bd30b52d) SHA1(9f8282e684415b4045218cf764ef7d75a70e3240) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c6.bin", 0x2000001, 0x800000, CRC(86a69c70) SHA1(526732cdb408cf680af9da39057bce6a4dfb5e13) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "270-c7.bin", 0x3000000, 0x800000, CRC(d28fbc3c) SHA1(a82a6ba6760fad14d9309f9147cb7d80bd6f70fc) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "270-c8.bin", 0x3000001, 0x800000, CRC(02c530a6) SHA1(7a3fafa6075506c6ef78cc4ec2cb72118ec83cb9) ) /* Plane 2,3 */
ROM_END

ROM_START( kof2003 ) /* Encrypted Set, Decrypted C */
ROM_REGION( 0x900000, REGION_CPU1, 0 )
ROM_LOAD32_WORD_SWAP( "271-p1.bin", 0x000000, 0x400000, CRC(b9da070c) SHA1(1a26325af142a4dd221c336061761468598c4634) )
ROM_LOAD32_WORD_SWAP( "271-p2.bin", 0x000002, 0x400000, CRC(da3118c4) SHA1(582e4f44f03276adecb7b2848d3b96bf6da57f1e) )
ROM_LOAD16_WORD_SWAP( "271-p3.bin", 0x800000, 0x100000, CRC(5cefd0d2) SHA1(cddc3164629fed4b6f715e12b109ad35d1009355) )
/* Decrypted */
ROM_LOAD16_WORD_SWAP( "271-p3d.bin", 0x800000, 0x100000, CRC(59d376da) SHA1(3c3ad0b79e8b37e838893a8f7b87e11d7eeee8f2) )

ROM_REGION( 0x100000, REGION_GFX1, 0 ) /* larger char set */
ROM_FILL( 0x000000, 0x100000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION16_BE( 0x40000, REGION_USER1, 0 )
ROM_LOAD16_WORD_SWAP( "271-bios.bin", 0x00000, 0x040000, CRC(c521b5bc) SHA1(c9a5db63523191dedd1b39baab8772f64f09b77f) )
NEOGEO_BIOS

ROM_REGION( 0x90000, REGION_CPU2, 0 )
ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
/* Decrypted */
ROM_LOAD( "271-m1_decrypted.bin", 0x00000, 0x80000, CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) )
ROM_RELOAD( 0x10000, 0x80000 )
ROM_REGION( 0x10000, REGION_GFX4, 0 )
ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "271-v1.bin", 0x000000, 0x1000000, CRC(1d96154b) SHA1(1d4e262b0d30cee79a4edc83bb9706023c736668) )

NO_DELTAT_REGION

ROM_REGION( 0x6000000, REGION_GFX3, 0 )
/* Decrypted */
ROM_LOAD16_BYTE( "271-c1d.bin", 0x0000000, 0x1000000, CRC(c29acd28) SHA1(8a10409c5a9ad95fa9b56e94c14f1b96101fb179) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "271-c2d.bin", 0x0000001, 0x1000000, CRC(328e80b1) SHA1(c7f8069488be1a88a2ea03718b6a131f5c96bd3f) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "271-c3d.bin", 0x2000000, 0x1000000, CRC(020a11f1) SHA1(85cfae76234f72b0039ebc02f931bb2a9c10b1af) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "271-c4d.bin", 0x2000001, 0x1000000, CRC(991b5ed2) SHA1(99c4c470bc9cb388773e27de6df4a16803fc7b45) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "271-c5d.bin", 0x4000000, 0x1000000, CRC(c2de8b66) SHA1(40c2ea48fc20d470163a9dbb40c0276fc4cfceb9) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "271-c6d.bin", 0x4000001, 0x1000000, CRC(3ff750db) SHA1(714f14a2eb2df6f25d10a6b6aff4b3adfbc7a5dc) ) /* Plane 2,3 */
ROM_END

ROM_START( kof2k3uf ) /* Kof2003 Hack, S1 Fix */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "271-p1up.bin", 0x000000, 0x800000, CRC(87294c01) SHA1(21420415a6b2ba1b43ecc1934270dc085d6bd7d9) )

ROM_REGION( 0x80000, REGION_GFX1, 0 )
ROM_LOAD( "271-s1up.bin", 0x000000, 0x80000, CRC(4791dc0c) SHA1(e27d108f51571991f0ce718536577b5db02ccd8b) )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

NEO_BIOS_SOUND_512K( "271-m1_decrypted.bin", CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
ROM_LOAD( "271-v1.bin", 0x000000, 0x1000000, CRC(1d96154b) SHA1(1d4e262b0d30cee79a4edc83bb9706023c736668) )

NO_DELTAT_REGION

ROM_REGION( 0x6000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "271-c1d.bin", 0x0000000, 0x1000000, CRC(c29acd28) SHA1(8a10409c5a9ad95fa9b56e94c14f1b96101fb179) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "271-c2d.bin", 0x0000001, 0x1000000, CRC(328e80b1) SHA1(c7f8069488be1a88a2ea03718b6a131f5c96bd3f) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "271-c3d.bin", 0x2000000, 0x1000000, CRC(020a11f1) SHA1(85cfae76234f72b0039ebc02f931bb2a9c10b1af) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "271-c4d.bin", 0x2000001, 0x1000000, CRC(991b5ed2) SHA1(99c4c470bc9cb388773e27de6df4a16803fc7b45) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "271-c5d.bin", 0x4000000, 0x1000000, CRC(c2de8b66) SHA1(40c2ea48fc20d470163a9dbb40c0276fc4cfceb9) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "271-c6d.bin", 0x4000001, 0x1000000, CRC(3ff750db) SHA1(714f14a2eb2df6f25d10a6b6aff4b3adfbc7a5dc) ) /* Plane 2,3 */
ROM_END

ROM_START( samsh5sp ) /* Encrypted Set */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "272-p1.bin", 0x000000, 0x400000, CRC(9291794d) SHA1(66588ff9b00ffad6508b03423548984e28a3209d) )
ROM_LOAD16_WORD_SWAP( "272-p2.bin", 0x400000, 0x400000, CRC(fa1a7dd8) SHA1(62443dad76d6c1e18f515d7d4ef8e1295a4b7f1d) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
ROM_REGION( 0x80000, REGION_GFX1, 0 ) /* larger char set */
ROM_FILL( 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
/* Encrypted, we load it here for reference and replace with decrypted ROM */
ROM_LOAD( "272-m1.bin", 0x00000, 0x80000, CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
/* Decrypted */
NEO_BIOS_SOUND_512K( "272-m1_decrypted.bin", CRC(203d744e) SHA1(24fc73943009effa14eed0f7a29955f349ca8e8f) )

ROM_REGION( 0x1000000, REGION_SOUND1, 0 )
/* Encrypted */
ROM_LOAD( "272-v1.bin", 0x000000, 0x800000, CRC(76a94127) SHA1(c3affd7ff1eb02345cfb755962ec173a8ec34acd) )
ROM_LOAD( "272-v2.bin", 0x800000, 0x800000, CRC(4ba507f1) SHA1(728d139da3fe8a391fd8be4d24bb7fdd4bf9548a) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "272-c1.bin", 0x0000000, 0x800000, CRC(4f97661a) SHA1(87f1721bae5ef16bc23c06b05e64686c396413df) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "272-c2.bin", 0x0000001, 0x800000, CRC(a3afda4f) SHA1(86b475fce0bc0aa04d34e31324e8c7c7c847df19) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "272-c3.bin", 0x1000000, 0x800000, CRC(8c3c7502) SHA1(6639020a8860d2400308e110d7277cbaf6eccc2a) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "272-c4.bin", 0x1000001, 0x800000, CRC(32d5e2e2) SHA1(2b5612017152afd7433aaf99951a084ef5ad6bf0) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "272-c5.bin", 0x2000000, 0x800000, CRC(6ce085bc) SHA1(0432b04a2265c649bba1bbd934dfb425c5d80fb1) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "272-c6.bin", 0x2000001, 0x800000, CRC(05c8dc8e) SHA1(da45c222893f25495a66bdb302f9b0b1de3c8ae0) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "272-c7.bin", 0x3000000, 0x800000, CRC(1417b742) SHA1(dfe35eb4bcd022d2f2dc544ccbbb77078f08c0aa) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "272-c8.bin", 0x3000001, 0x800000, CRC(d49773cd) SHA1(cd8cf3b762d381c1f8f12919579c84a7ef7efb3f) ) /* Plane 2,3 */
ROM_END

-------------------------------------
put this at the end of the Driver Init section
-------------------------------------

/* Bootleg Decryption Routine */
static void samsh5bl_sx_decrypt( void )
{
int i;
UINT8 *dst = malloc(0x20000);
UINT8 *rom = memory_region(REGION_GFX1);

if ( dst )
{
memcpy(dst,rom,0x20000);
for (i = 0; i < 0x20000; i += 0x000010 )
{
memcpy( rom + i, dst + i + 8, 8 );
memcpy( rom + i + 8, dst + i, 8 );
}
}
free(dst);
}

DRIVER_INIT( kog )
{
int i;
UINT8 *src = memory_region( REGION_CPU1 );
UINT8 *pTemp = (UINT8 *)malloc( 0x600000 );
int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
int cx_size = memory_region_length( REGION_GFX3 );
UINT8 *rom = memory_region( REGION_GFX3 );
UINT8 *buf = malloc( cx_size );

if (pTemp) // Decrypt P
{
for (i = 0; i < 8; i++)
memcpy (pTemp + i * 0x20000, src + sec[i] * 0x20000, 0x20000);

memcpy (pTemp + 0x0007A6, src + 0x0407A6, 0x000006);
memcpy (pTemp + 0x0007C6, src + 0x0407C6, 0x000006);
memcpy (pTemp + 0x0007E6, src + 0x0407E6, 0x000006);
memcpy (pTemp + 0x090000, src + 0x040000, 0x004000);
memcpy (pTemp + 0x100000, src + 0x200000, 0x400000);
memcpy (src, pTemp, 0x600000);
free (pTemp);
}
for (i = 0x90000; i < 0x94000; i++)
{
if (((*((UINT16*)(src + i))&0xFFBF) == 0x4EB9 || *((UINT16*)(src + i)) == 0x43F9) && !*((UINT16*)(src + i + 2)))
*((UINT16*)(src + i + 2)) = 0x0009;

if (*((UINT16*)(src + i)) == 0x4EB8)
*((UINT16*)(src + i)) = 0x6100;
}

*((UINT16*)(src + 0x007A8)) = 0x0009;
*((UINT16*)(src + 0x007C8)) = 0x0009;
*((UINT16*)(src + 0x007E8)) = 0x0009;
*((UINT16*)(src + 0x93408)) = 0xF168;
*((UINT16*)(src + 0x9340C)) = 0xFB7A;
*((UINT16*)(src + 0x924AC)) = 0x0009;
*((UINT16*)(src + 0x9251C)) = 0x0009;
*((UINT16*)(src + 0x93966)) = 0xFFDA;
*((UINT16*)(src + 0x93974)) = 0xFFCC;
*((UINT16*)(src + 0x93982)) = 0xFFBE;
*((UINT16*)(src + 0x93990)) = 0xFFB0;
*((UINT16*)(src + 0x9399E)) = 0xFFA2;
*((UINT16*)(src + 0x939AC)) = 0xFF94;
*((UINT16*)(src + 0x939BA)) = 0xFF86;
*((UINT16*)(src + 0x939C8)) = 0xFF78;
*((UINT16*)(src + 0x939D4)) = 0xFA5C;
*((UINT16*)(src + 0x939E0)) = 0xFA50;
*((UINT16*)(src + 0x939EC)) = 0xFA44;
*((UINT16*)(src + 0x939F8)) = 0xFA38;
*((UINT16*)(src + 0x93A04)) = 0xFA2C;
*((UINT16*)(src + 0x93A10)) = 0xFA20;
*((UINT16*)(src + 0x93A1C)) = 0xFA14;
*((UINT16*)(src + 0x93A28)) = 0xFA08;
*((UINT16*)(src + 0x93A34)) = 0xF9FC;
*((UINT16*)(src + 0x93A40)) = 0xF9F0;
*((UINT16*)(src + 0x93A4C)) = 0xFD14;
*((UINT16*)(src + 0x93A58)) = 0xFD08;
*((UINT16*)(src + 0x93A66)) = 0xF9CA;
*((UINT16*)(src + 0x93A72)) = 0xF9BE;

src[0xFFFFE] = 0x01; // Enable "King of Gladiator" on Title Screen

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

samsh5bl_sx_decrypt();
init_neogeo();
}

DRIVER_INIT( lans2004 )
{
int i;
UINT8 *src = memory_region( REGION_CPU1 );
UINT16 *rom = (UINT16*)memory_region( REGION_CPU1 );
UINT8 *dst = malloc(0x600000);
UINT8 *vrom = memory_region( REGION_SOUND1 );
int cx_size = memory_region_length( REGION_GFX3 );
UINT8 *crom = memory_region( REGION_GFX3 );
UINT8 *buf = malloc( 128 );

if (dst) // Decrypt P
{
int sec[8] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };

for (i = 0; i < 8; i++)
memcpy (dst + i * 0x20000, src + sec[i] * 0x20000, 0x20000);
memcpy (dst + 0x0BBB00, src + 0x045B00, 0x001710);
memcpy (dst + 0x02FFF0, src + 0x1A92BE, 0x000010);
memcpy (dst + 0x100000, src + 0x200000, 0x400000);
memcpy (src, dst, 0x600000);
free (dst);
}
for (i = 0xBBB00/2; i < 0xBE000/2; i++)
{
if ((((rom[i]&0xFFBF)==0x4EB9) || ((rom[i]&0xFFBF)==0x43B9)) && (rom[i+1]==0x0000))
{
rom[i + 1] = 0x000B;
rom[i + 2] += 0x6000;
}
}
for (i = 0; i < 0x100000/2; i++)
{
if ((rom[i]==0xBE79) && (rom[i+1]==0x0010)) rom[i+3] = 0x6002;
}

rom[0x2D15C/2] = 0x000B;
rom[0x2D15E/2] = 0xBB00;

for (i = 0; i < 0xA00000; i++) // Decrypt V
{
vrom[i] = BITSWAP8(vrom[i], 0, 1, 5, 4, 3, 2, 6, 7);
}
for ( i=0; i < cx_size; i+=128) // Decrypt C
{
memcpy(buf, crom + i + 64, 64);
memcpy(buf + 64, crom + i, 64);
memcpy(crom + i, buf, 128);
}
free(buf);

samsh5bl_sx_decrypt();
init_neogeo();
}

DRIVER_INIT( cthd2003 ) // Thanks to Razoola
{
UINT8 *mtmp = (UINT8*)malloc(8*128*128);
UINT8 *stmp = (UINT8*)malloc(8*128*128);
UINT8 *mromdata = memory_region(REGION_CPU2)+0x10000;
UINT8 *sromdata = memory_region(REGION_GFX1);

memcpy( mtmp+8*0*128, mromdata+8*0*128, 8*32*128 ); // Descramble M
memcpy( mtmp+8*32*128, mromdata+8*64*128, 8*32*128 );
memcpy( mtmp+8*64*128, mromdata+8*32*128, 8*32*128 );
memcpy( mtmp+8*96*128, mromdata+8*96*128, 8*32*128 );
memcpy( mromdata, mtmp, 8*128*128 );
  free(mtmp);
memcpy( mromdata-0x10000, mromdata, 0x10000 );

memcpy( stmp+8*0*128, sromdata+8*0*128, 8*32*128 ); // Descramble S
memcpy( stmp+8*32*128, sromdata+8*64*128, 8*32*128 );
memcpy( stmp+8*64*128, sromdata+8*32*128, 8*32*128 );
memcpy( stmp+8*96*128, sromdata+8*96*128, 8*32*128 );
memcpy( sromdata, stmp, 8*128*128 );
  free(stmp);

cthd2003_c(0); // Already in Mame32 Plus! Code.
init_neogeo();
}

DRIVER_INIT( pnyaa )
{
neo_pcm2_snk_1999(4);
neogeo_fix_bank_type = 1;
kof2000_neogeo_gfx_decrypt(0x2e);
init_neogeo();
}

DRIVER_INIT( kf2k4spe )
{
int i;
unsigned int sec[] = {0x300000,0x200000,0x100000,0x000000};
UINT8 *src = memory_region(REGION_CPU1)+0x100000;
UINT8 *dst = malloc(0x400000);

if (dst) // Descramble P
{
memcpy(dst,src,0x400000);
for(i = 0; i < 4; ++i)
{
memcpy(src+i*0x100000,dst+sec[i],0x100000);
}
free(dst);
}

neo_pcm2_swap(0);
init_neogeo();
}

DRIVER_INIT( kof10th ) // Thanks to IQ_132
{
int i, j;
UINT8 *dst = malloc(0x900000);
UINT8 *src = memory_region( REGION_CPU1 );
UINT8 *srm = memory_region( REGION_GFX1 );

if (dst) // Decrypt P
{
memcpy(dst + 0x000000, src + 0x700000, 0x100000);
memcpy(dst + 0x100000, src + 0x000000, 0x800000);
for (i = 0; i < 0x900000; i++)
{
j = (i&0xFFF000) + BITSWAP16(i&0xFFF,15,14,13,12,11,2,9,8,7,1,5,4,3,10,6,0);
src[j] = dst[i];
}
free(dst);
}
// Altera protection chip patches these over P ROM
((UINT16*)src)[0x0124/2] = 0x000d; // Enables XOR for RAM moves, forces SoftDIPs, and USA region
((UINT16*)src)[0x0126/2] = 0xf7a8;

((UINT16*)src)[0x8bf4/2] = 0x4ef9; // Run code to change "S" data
((UINT16*)src)[0x8bf6/2] = 0x000d;
((UINT16*)src)[0x8bf8/2] = 0xf980;
  for (i = 0; i < 0x10000; i++) // Decrypt S
{ // Get S data, should be done on the fly
  srm[0x00000+(i^1)]=BITSWAP8(src[0x600000+i]^0xf3,7,6,0,4,3,2,1,5);
  srm[0x10000+(i^1)]=BITSWAP8(src[0x6d0000+i]^0xf3,7,6,0,4,3,2,1,5);
}
  for (i = 0; i < 0x04000; i++)
{
srm[0x02000+(i^1)]=BITSWAP8(src[0x6c2000+i]^0xf3,7,6,0,4,3,2,1,5);
srm[0x12000+(i^1)]=BITSWAP8(src[0x612000+i]^0xf3,7,6,0,4,3,2,1,5);
}

init_neogeo();
}

DRIVER_INIT( kf10thep ) // Thanks to IQ_132, JotaCE, Jimmy_page, Robber804
{
int i;
UINT8 *src = memory_region(REGION_CPU1);
UINT8 *dst = (UINT8*)malloc(0x800000);
UINT16 *tmp = (UINT16*)src;

if (dst) // Decrypt P
{
unsigned int nBank[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
memcpy (dst, src, 0x800000);
for (i = 0; i < 8; i++)
{
memcpy (src + i * 0x20000, dst + nBank[i] * 0x20000, 0x20000);
}
memcpy(src + 0x0002e0, dst + 0x0402e0, 0x06a);
memcpy(src + 0x0f92bc, dst + 0x0492bc, 0xb9e);
memcpy(src + 0x100000, dst + 0x200000, 0x600000);
free(dst);
}
for (i = 0xf92bc/2; i < 0xf9e58/2; i++)
{
if ((tmp[i] & 0xff0f) == 0x4E09 && !tmp[i+1])
{
tmp[i+1] = 0x000F;
}
}
tmp[0x00342/2] = 0x000F;

samsh5bl_sx_decrypt();
init_neogeo();
}

DRIVER_INIT( kf2k5uni ) // Thanks to IQ_132, Fataku
{
int i, j, ofst;
unsigned char *src = memory_region( REGION_CPU1 );
unsigned char *dst = (unsigned char*)malloc(0x80);
UINT8 *srom = memory_region( REGION_GFX1 );
UINT8 *mrom = memory_region( REGION_CPU2 )+0x10000;

for (i = 0; i < 0x800000; i+=0x80) // Decrypt P
{
for (j = 0; j < 0x80; j+=2)
{
ofst = BITSWAP8(j, 0, 3, 4, 5, 6, 1, 2, 7);
memcpy(dst + j, src + i + ofst, 2);
}
memcpy(src + i, dst, 0x80);
}
free(dst);
memcpy(src, src + 0x600000, 0x100000); // Seems to be the same as kof10th
for (i = 0; i < 0x20000; i++) // Decrypt S, M
{
srom[i] = BITSWAP8(srom[i], 4, 5, 6, 7, 0, 1, 2, 3);
mrom[i] = BITSWAP8(mrom[i], 4, 5, 6, 7, 0, 1, 2, 3);
}
memcpy(mrom-0x10000,mrom,0x10000);

init_neogeo();
}

DRIVER_INIT( kof2km2 )
{
unsigned char *src = memory_region(REGION_CPU1);
unsigned char *dst = (unsigned char*)malloc(0x600000);

memcpy (dst + 0x000000, src + 0x1C0000, 0x040000); // Descramble P
memcpy (dst + 0x040000, src + 0x140000, 0x080000);
memcpy (dst + 0x0C0000, src + 0x100000, 0x040000);
memcpy (dst + 0x100000, src + 0x200000, 0x400000);
memcpy (src + 0x000000, dst + 0x000000, 0x600000);
free (dst);

samsh5bl_sx_decrypt();
neo_pcm2_swap(0);
neogeo_fix_bank_type = 0;
kof2000_neogeo_gfx_decrypt(0xec);
init_neogeo();
}

/* Additional V-Rom Decryption Routines */
static void neo_pcm2_playmore_2002(int value) /* 0=mslug5, 1=svcchaos, 2=samsho5, 3=kof2003, 4=samsh5sp */
{ /* offset,xor address, thanks to vconv for NEO-PCM2 info */
unsigned int addrs[5][2]={
{0xFE2CF6,0x4E001}, /* mslug5 */
{0xFFAC28,0xC2000}, /* svcchaos */
{0xFEB2C0,0x0A000}, /* samsho5 */
{0xFF14EA,0xA7001}, /* kof2003 */
{0xFFB440,0x02000}};  /* samsh5sp */
unsigned int xordata[5][8]={
{0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, /* mslug5 */
{0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, /* svcchaos */
{0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, /* samsho5 */
{0x4B,0xA4,0x63,0x46,0xF0,0x91,0xEA,0x62}, /* kof2003 */
{0x4B,0xA4,0x63,0x46,0xF0,0x91,0xEA,0x62}};  /* samsh5sp */
UINT8 *src = memory_region(REGION_SOUND1);
UINT8 *buf = malloc(0x1000000);
int i, j, d;

memcpy(buf,src,0x1000000);
for (i=0;i<0x1000000;i++)
{
j=BITSWAP24(i,23,22,21,20,19,18,17,0,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,16);
j=j^addrs[value][1];
d=((i+addrs[value][0])&0xffffff);
src[j]=buf[d]^xordata[value][j&0x7];
}
free(buf);
}

DRIVER_INIT( mslug5 ) /* By HalRIN */
{
const unsigned char xor1[ 0x20 ] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 };
const unsigned char xor2[ 0x20 ] = { 0x36, 0x09, 0xb0, 0x64, 0x95, 0x0f, 0x90, 0x42, 0x6e, 0x0f, 0x30, 0xf6, 0xe5, 0x08, 0x30, 0x64, 0x08, 0x04, 0x00, 0x2f, 0x72, 0x09, 0xa0, 0x13, 0xc9, 0x0b, 0xa0, 0x3e, 0xc2, 0x00, 0x40, 0x2b };
int i;
int ofst;
int rom_size = 0x800000;
UINT8 *rom = memory_region( REGION_CPU1 );
UINT8 *buf = malloc( rom_size );

for( i = 0; i < 0x100000; i++ ) // Decrypt P
{
rom[ i ] ^= xor1[ (i % 0x20) ];
}
for( i = 0x100000; i < 0x800000; i++ )
{
rom[ i ] ^= xor2[ (i % 0x20) ];
}
for( i = 0x100000; i < 0x0800000; i += 4 )
{
UINT16 *rom16 = (UINT16*)&rom[ i + 1 ];
*rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 );
}
memcpy( buf, rom, rom_size );
for( i = 0; i < 0x0100000 / 0x10000; i++ )
{
ofst = (i & 0xf0) + BITSWAP8( (i & 0x0f), 7, 6, 5, 4, 1, 0, 3, 2 );
memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 );
}
for( i = 0x100000; i < 0x800000; i += 0x100 )
{
ofst = (i & 0xf000ff) + ((i & 0x000f00) ^ 0x00700) + (BITSWAP8( ((i & 0x0ff000) >> 12), 5, 4, 7, 6, 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 );
free( buf );

neo_pcm2_playmore_2002(0);
neogeo_fix_bank_type = 1;
kof2000_neogeo_gfx_decrypt(0x19);
init_neogeo();
}

DRIVER_INIT( ms5plus )
{
UINT8 *dst = malloc(0x20000);
UINT8 *roms1 = (memory_region(REGION_GFX1));
int i;

if ( dst ) // Descramble S
{
memcpy( dst,roms1,0x20000 );
for ( i=0; i<0x20000; i+=0x000010 )
{
memcpy( roms1+i, dst+i+0x000008, 8);
memcpy( roms1+i+0x000008, dst+i, 8);
}
}
free( dst );

neo_pcm2_playmore_2002(0);
neogeo_fix_bank_type = 1;
kof2000_neogeo_gfx_decrypt(0x19);
init_neogeo();
}

/* SvC Functions By HalRIN */
static void svcchaos_px_decrypt( void )
{
const unsigned char 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 };
const unsigned char 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 = memory_region( REGION_CPU1 );
UINT8 *buf = malloc( rom_size );

for( i = 0; i < 0x100000; i++ )
{
rom[ i ] ^= xor1[ (i % 0x20) ];
}
for( i = 0x100000; i < 0x800000; i++ )
{
rom[ i ] ^= xor2[ (i % 0x20) ];
}
for( i = 0x100000; i < 0x800000; i += 4 )
{
UINT16 *rom16 = (UINT16*)&rom[ i + 1 ];
*rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 );
}
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 );
free( buf );
}

static void svcchaos_gfx_decrypt( void )
{
   const unsigned char xor[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
   int i;
   int ofst;
   int rom_size = memory_region_length( REGION_GFX3 );
   UINT8 *rom = memory_region( REGION_GFX3 );
   UINT8 *buf = malloc( rom_size );

   for( i = 0; i < rom_size; i++ )
   {
      rom[ i ] ^= xor[ (i % 4) ];
   }
   for( i = 0; i < rom_size; i += 4 )
   {
      UINT32 *rom32 = (UINT32*)&rom[ i ];
      *rom32 = BITSWAP32( *rom32, 0x09, 0x0d, 0x13, 0x00, 0x17, 0x0f, 0x03, 0x05, 0x04, 0x0c, 0x11, 0x1e, 0x12, 0x15, 0x0b, 0x06, 0x1b, 0x0a, 0x1a, 0x1c, 0x14, 0x02, 0x0e, 0x1d, 0x18, 0x08, 0x01, 0x10, 0x19, 0x1f, 0x07, 0x16 );
   }
   memcpy( buf, rom, rom_size );
   for( i = 0; i < rom_size / 4; i++ )
   {
      ofst =  BITSWAP24( (i
« Last Edit: December 12, 2005, 12:32:57 AM by CyborgSuperman »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3619
  • Karma: +385/-0
  • Bare Knuckle!
    • NeoSource
Re: Graphics GLitches in Neo Geo Games...
« Reply #1 on: December 12, 2005, 12:45:34 AM »
Sounds like you don't have it extracting the S data from the end of the Cs.

You should have this in your src/driver/neogeo.c in its complete form.

Code: [Select]
static void neogeo_gfx_decrypt(int extra_xor)
{
int rom_size;
UINT8 *buf;
UINT8 *rom;
int rpos;

rom_size = memory_region_length(REGION_GFX3);

buf = malloc(rom_size);

if (!buf) return;

rom = memory_region(REGION_GFX3);

// Data xor
for (rpos = 0;rpos < rom_size/4;rpos++)
{
decrypt(buf+4*rpos+0, buf+4*rpos+3, rom[4*rpos+0], rom[4*rpos+3], type0_t03, type0_t12, type1_t03, rpos, (rpos>>8) & 1);
decrypt(buf+4*rpos+1, buf+4*rpos+2, rom[4*rpos+1], rom[4*rpos+2], type0_t12, type0_t03, type1_t12, rpos, ((rpos>>16) ^ address_16_23_xor2[(rpos>>8) & 0xff]) & 1);
}

// Address xor
for (rpos = 0;rpos < rom_size/4;rpos++)
{
int baser;

baser = rpos;

baser ^= extra_xor;

baser ^= address_8_15_xor1[(baser >> 16) & 0xff] << 8;
baser ^= address_8_15_xor2[baser & 0xff] << 8;
baser ^= address_16_23_xor1[baser & 0xff] << 16;
baser ^= address_16_23_xor2[(baser >> 8) & 0xff] << 16;
baser ^= address_0_7_xor[(baser >> 8) & 0xff];

/* special handling for preisle2 */
if (rom_size == 0x3000000)
{
if (rpos < 0x2000000/4)
baser &= (0x2000000/4)-1;
else
baser = 0x2000000/4 + (baser & ((0x1000000/4)-1));
}
else /* Clamp to the real rom size */
baser &= (rom_size/4)-1;

rom[4*rpos+0] = buf[4*baser+0];
rom[4*rpos+1] = buf[4*baser+1];
rom[4*rpos+2] = buf[4*baser+2];
rom[4*rpos+3] = buf[4*baser+3];
}

free(buf);


/* the S data comes from the end fo the C data */
{
int i;
int tx_size = memory_region_length(REGION_GFX1);
UINT8 *src = memory_region(REGION_GFX3)+rom_size-tx_size;
UINT8 *dst = memory_region(REGION_GFX1);

for (i = 0;i < tx_size;i++)
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
}
}


Offline CyborgSuperman

  • Newbies
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Graphics GLitches in Neo Geo Games...
« Reply #2 on: December 12, 2005, 10:50:51 PM »
Wait!  I think there may be a syntax error or something in the following lines that I have near the end of neocrypt.c in source/machine.  It goes like this:
Code: [Select]
/* the S data comes from the end of the C data */
void neogeo_sfix_decrypt(void)
{
if (strcmp(Machine->gamedrv->name,"ms5plus"))
if (strcmp(Machine->gamedrv->name,"svcsplsf"))
if (strcmp(Machine->gamedrv->name,"kof2km2"))
{
int i;
int rom_size = memory_region_length(REGION_GFX3);
int tx_size = memory_region_length(REGION_GFX1);
UINT8 *src = memory_region(REGION_GFX3)+rom_size-tx_size;
UINT8 *dst = memory_region(REGION_GFX1);

for (i = 0;i < tx_size;i++)
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
}
}
I'm taking this code as meaning "only remove the S data from the end of the C data if it's for the following games (ms5plus, svcsplsf, kof2km), otherwise DON'T remove the S data from anything."
Am I interpreting this correctly?  I assume, then, that the S Data actually SHOULDN'T be extracted from the end of the C data on these three games, yes?  If so, how do I code it so that it states the action properly?

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Re: Graphics GLitches in Neo Geo Games...
« Reply #3 on: December 13, 2005, 12:19:59 PM »
I see his problem . There is nothing wrong with the code he is useing



CyborgSuperman Try this just change the rom names to match yours
Code: [Select]
static void neogeo_gfx_decrypt(int extra_xor)
{
int rom_size;
UINT8 *buf;
UINT8 *rom;
int rpos;

rom_size = memory_region_length(REGION_GFX3);

buf = malloc(rom_size);

if (!buf) return;

rom = memory_region(REGION_GFX3);

// Data xor
for (rpos = 0;rpos < rom_size/4;rpos++)
{
decrypt(buf+4*rpos+0, buf+4*rpos+3, rom[4*rpos+0], rom[4*rpos+3], type0_t03, type0_t12, type1_t03, rpos, (rpos>>8) & 1);
decrypt(buf+4*rpos+1, buf+4*rpos+2, rom[4*rpos+1], rom[4*rpos+2], type0_t12, type0_t03, type1_t12, rpos, ((rpos>>16) ^ address_16_23_xor2[(rpos>>8) & 0xff]) & 1);
}

// Address xor
for (rpos = 0;rpos < rom_size/4;rpos++)
{
int baser;

baser = rpos;

baser ^= extra_xor;

baser ^= address_8_15_xor1[(baser >> 16) & 0xff] << 8;
baser ^= address_8_15_xor2[baser & 0xff] << 8;
baser ^= address_16_23_xor1[baser & 0xff] << 16;
baser ^= address_16_23_xor2[(baser >> 8) & 0xff] << 16;
baser ^= address_0_7_xor[(baser >> 8) & 0xff];

/* special handling for preisle2 */
if (rom_size == 0x3000000)
{
if (rpos < 0x2000000/4)
baser &= (0x2000000/4)-1;
else
baser = 0x2000000/4 + (baser & ((0x1000000/4)-1));
}
else /* Clamp to the real rom size */
baser &= (rom_size/4)-1;

rom[4*rpos+0] = buf[4*baser+0];
rom[4*rpos+1] = buf[4*baser+1];
rom[4*rpos+2] = buf[4*baser+2];
rom[4*rpos+3] = buf[4*baser+3];
}

free(buf);


/* the S data comes from the end fo the C data */
{
/* Start X-or */
if (strcmp(Machine->gamedrv->name,"ms5plus"))
if (strcmp(Machine->gamedrv->name,"kf2k2pls"))
{
/* End X-or */
int i;
int tx_size = memory_region_length(REGION_GFX1);
UINT8 *src = memory_region(REGION_GFX3)+rom_size-tx_size;
UINT8 *dst = memory_region(REGION_GFX1);

for (i = 0;i < tx_size;i++)
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
}
}
}
« Last Edit: December 13, 2005, 12:26:12 PM by James33 »
IQ Forum Member