Jump to content

James

1Emu Veteran
  • Posts

    2,897
  • Joined

  • Last visited

Everything posted by James

  1. Mame32 v101u5 http://www.classicgaming.com/mame32qa/ Mame Plus! v101u5 http://mameplus.emu-france.com/ Mame32 FX v101u5 http://mame32fx.altervista.org/home.htm
  2. looks like you are missing the bankswitch which is for a few other drivers like kof2003 svcchaos etc . I have no idea how you have missed such code. This code goes in machine\neogeo.c /* PCB init info Thanks to IQ for the mame conversion */ static unsigned short CartRAM[0x1000]; unsigned char pvc_r8(unsigned int address) { return *(((unsigned char *)CartRAM)+((address^1)-0x2fe000)); } void pvc_w8(unsigned int address, unsigned char data) { *(((unsigned char *)CartRAM)+((address^1)-0x2fe000))=data; } // These perform some palette calculations // Unpack palette word to RGB dword, thanks to bms888 void pvc_prot1( void ) // on writes to e0/e1 { unsigned char b1, b2; b1 = pvc_r8(0x2fffe0); b2 = pvc_r8(0x2fffe1); pvc_w8(0x2fffe3,(((b2>>0)&0xf)<<1)|((b1>>4)&1)); pvc_w8(0x2fffe2,(((b2>>4)&0xf)<<1)|((b1>>5)&1)); pvc_w8(0x2fffe5,(((b1>>0)&0xf)<<1)|((b1>>6)&1)); pvc_w8(0x2fffe4, (b1>>7)); } void pvc_prot2( void ) // on writes to e8/e9/ea/eb { unsigned char b1, b2, b3, b4; b1 = pvc_r8(0x2fffe8); b2 = pvc_r8(0x2fffe9); b3 = pvc_r8(0x2fffea); b4 = pvc_r8(0x2fffeb); pvc_w8(0x2fffed,(b2>>1)|((b1>>1)<<4)); pvc_w8(0x2fffec,(b4>>1)|((b2&1)<<4)|((b1&1)<<5)|((b4&1)<<6)|((b3&1)<<7)); } void pvc_write_bankswitch( void ) { UINT32 bankaddress; bankaddress = ((CartRAM[0xff8]>>8)|(CartRAM[0xff9]<<8))+0x100000; neogeo_set_cpu1_second_bank(bankaddress); } static WRITE16_HANDLER( pvc_prot_w ) { COMBINE_DATA( &CartRAM[ offset ] ); if (offset == 0xFF0)pvc_prot1(); else if(offset >= 0xFF4 && offset <= 0xFF5)pvc_prot2(); else if(offset >= 0xFF8 && offset <= 0xFF9)pvc_write_bankswitch(); } static READ16_HANDLER( pvc_prot_r ) { if (offset >= 0xFF8) { if(CartRAM[0xFF8] == 0xffff) { CartRAM[0xFF8] = 0xfea0; CartRAM[0xFF9] = 0x7fff; } if(CartRAM[0xFF8] == 0x0000) { CartRAM[0xFF8] = 0x00a0; } } return CartRAM[ offset ]; } static READ16_HANDLER( kof2003b_prot_byte ) { return CartRAM[0xff9]; } if (!strcmp(Machine->gamedrv->name,"mslug5") || !strcmp(Machine->gamedrv->name,"mslug5nd")) { /* Patch out loop to disable console mode */ UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); mem16[0x122a >> 1] = 0x4e75; memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, pvc_prot_r); memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, pvc_prot_w);; } This is how I load kof96evo ROM_START( kof96evo ) /* Hack */ ROM_REGION( 0x300000, REGION_CPU1, 0 ) ROM_LOAD16_WORD_SWAP( "214p-p1.bin", 0x000000, 0x200000, CRC(6e10e1af) SHA1(f013e827e74a296d462bd00594b823dd02b4dc76) ) ROM_LOAD16_WORD_SWAP( "214-p2.bin", 0x100000, 0x200000, CRC(002ccb73) SHA1(3ae8df682c75027ca82db25491021eeba00a267e) ) NEO_SFIX_128K( "214-s1.bin", CRC(1254cbdb) SHA1(fce5cf42588298711a3633e9c9c1d4dcb723ac76) ) NEO_BIOS_SOUND_128K( "214-m1.bin", CRC(dabc427c) SHA1(b76722ed142ee7addceb4757424870dbd003e8b3) ) ROM_REGION( 0xa00000, REGION_SOUND1, ROMREGION_SOUNDONLY ) ROM_LOAD( "214-v1.bin", 0x000000, 0x400000, CRC(63f7b045) SHA1(1353715f1a8476dca6f8031d9e7a401eacab8159) ) ROM_LOAD( "214-v2.bin", 0x400000, 0x400000, CRC(25929059) SHA1(6a721c4cb8f8dc772774023877d4a9f50d5a9e31) ) ROM_LOAD( "214-v3.bin", 0x800000, 0x200000, CRC(92a2257d) SHA1(5064aec78fa0d104e5dd5869b95382aa170214ee) ) NO_DELTAT_REGION ROM_REGION( 0x2000000, REGION_GFX3, 0 ) ROM_LOAD16_BYTE( "214-c1.bin", 0x0000000, 0x400000, CRC(7ecf4aa2) SHA1(f773c4c1f05d58dd37e7bb2ac1d1e0ec43998a71) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "214-c2.bin", 0x0000001, 0x400000, CRC(05b54f37) SHA1(cc31653fe4cb05201fba234e080cb9c7a7592b1b) ) /* Plane 2,3 */ ROM_LOAD16_BYTE( "214-c3.bin", 0x0800000, 0x400000, CRC(64989a65) SHA1(e6f3749d43be0afa9dad7b085cb782ba694252ca) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "214-c4.bin", 0x0800001, 0x400000, CRC(afbea515) SHA1(ae875052728de33174827705646bd14cf3937b5c) ) /* Plane 2,3 */ ROM_LOAD16_BYTE( "214-c5.bin", 0x1000000, 0x400000, CRC(2a3bbd26) SHA1(7c1a7e50a10a1b082e0d0d515c34135ee9f995ac) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "214-c6.bin", 0x1000001, 0x400000, CRC(44d30dc7) SHA1(c8ae001e37224b55d9e4a4d99f6578b4f6eb055f) ) /* Plane 2,3 */ ROM_LOAD16_BYTE( "214-c7.bin", 0x1800000, 0x400000, CRC(3687331b) SHA1(2be95caab76d7af51674f93884330ba73a6053e4) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "214-c8.bin", 0x1800001, 0x400000, CRC(fa1461ad) SHA1(6c71a7f08e4044214223a6bf80984582ab5e0328) ) /* Plane 2,3 */ ROM_END
  3. No do it now. It will be fun
  4. I know what is causeing the kof96evo problem. Go to Machine\neogeo.c and this after !strcmp(Machine->gamedrv->name,"kof96") ||
  5. ROM_START( matrimbl ) /* Bootleg */ ROM_REGION( 0x500000, REGION_CPU1, 0 ) ROM_LOAD16_WORD_SWAP( "266-p1.bin", 0x000000, 0x100000, CRC(5d4c2dc7) SHA1(8d723b0d28ec344eef26009b361a2b97d300dd51) ) ROM_LOAD16_WORD_SWAP( "266-p2.bin", 0x100000, 0x400000, CRC(a14b1906) SHA1(1daa14d73512f760ef569b06f9facb279437d1db) ) ROM_REGION( 0x80000, 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( "266-m1b.bin", CRC(3ea96ab1) SHA1(e5053c4312f658faed2a34e38325a22ef792d384) ) ROM_REGION( 0X1000000, REGION_SOUND1, ROMREGION_SOUNDONLY ) /* byte swapped */ ROM_LOAD( "266b-v1d.bin", 0x000000, 0x400000, CRC(352b0a07) SHA1(19f7cc12f3f6d0fda9c7449816c4c32367447897) ) ROM_LOAD16_WORD_SWAP( "266b-v2d.bin", 0x400000, 0x400000, CRC(1e9bd59e) SHA1(0f754e780d0ebb815a92a45ad55f85f6d0181b70) ) ROM_LOAD( "266b-v3d.bin", 0x800000, 0x400000, CRC(e8362fcc) SHA1(42d558fd80cabe22a1c09a1fa75741afbcf46b7c) ) ROM_LOAD16_WORD_SWAP( "266b-v4d.bin", 0xc00000, 0x400000, CRC(c8c79b19) SHA1(9c7a5e694d68f37a27209e1400b60b6241a04cc7) ) NO_DELTAT_REGION ROM_REGION( 0x4000000, REGION_GFX3, 0 ) /* Scrambled GFX */ ROM_LOAD16_BYTE( "266-c1b.bin", 0x0000000, 0x800000, CRC(a5595656) SHA1(d86281607f22e4f2001047eaeeda99cd673c508c) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "266-c2b.bin", 0x0000001, 0x800000, CRC(c5f7c300) SHA1(9ff5ffb750bd2e925667d84389192f92183e8677) ) /* Plane 2,3 */ ROM_LOAD16_BYTE( "266-c3b.bin", 0x1000000, 0x800000, CRC(574efd7d) SHA1(6cac303db705fe2800701ee51de9e9fca04e6e66) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "266-c4b.bin", 0x1000001, 0x800000, CRC(109d54d9) SHA1(22cb748b3b14317b90d9d9951297ada2bfc3a3f1) ) /* Plane 2,3 */ ROM_LOAD16_BYTE( "266-c5b.bin", 0x2000000, 0x800000, CRC(15c9e882) SHA1(1c9f1ccaed4fdd9d8f5cc9b6fcaca3c4e328e59e) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "266-c6b.bin", 0x2000001, 0x800000, CRC(77497b97) SHA1(c6481bea5a36f8210971fdcb4bfbe7ed93c769de) ) /* Plane 2,3 */ ROM_LOAD16_BYTE( "266-c7b.bin", 0x3000000, 0x800000, CRC(ab481bb6) SHA1(6b2d97c5505eeb28e300b075f37f0d69ef44463a) ) /* Plane 0,1 */ ROM_LOAD16_BYTE( "266-c8b.bin", 0x3000001, 0x800000, CRC(906cf267) SHA1(b0f2cf8887794d715f208751ddd1ed26b2c3ffdf) ) /* Plane 2,3 */ ROM_END /* descrambling information from razoola */ static void matrimbl_neogeo_gfx_address_fix_do(int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift) { int i,j; int tilesize=128; UINT8* rom = (UINT8*)malloc(16*tilesize); // 16 tiles buffer UINT8* realrom = memory_region(REGION_GFX3) + start*tilesize; for (i = 0; i < (end-start)/16; i++) { for (j = 0; j < 16; j++) { int offset = (((j&1)>>0)<<bit0shift) +(((j&2)>>1)<<bit1shift) +(((j&4)>>2)<<bit2shift) +(((j&8)>>3)<<bit3shift); memcpy(rom+j*tilesize, realrom+offset*tilesize, tilesize); } memcpy(realrom,rom,tilesize*16); realrom+=16*tilesize; } free(rom); } static void matrimbl_neogeo_gfx_address_fix(int start, int end) { matrimbl_neogeo_gfx_address_fix_do(start+512*0, end+512*0, 0,3,2,1); matrimbl_neogeo_gfx_address_fix_do(start+512*1, end+512*1, 1,0,3,2); matrimbl_neogeo_gfx_address_fix_do(start+512*2, end+512*2, 2,1,0,3); // skip 3 & 4 matrimbl_neogeo_gfx_address_fix_do(start+512*5, end+512*5, 0,1,2,3); matrimbl_neogeo_gfx_address_fix_do(start+512*6, end+512*6, 0,1,2,3); matrimbl_neogeo_gfx_address_fix_do(start+512*7, end+512*7, 0,2,3,1); } static void matrimbl_c(int pow) { int i; for (i=0; i<=192; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=200; i<=392; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=400; i<=592; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=600; i<=792; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=800; i<=992; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=1000; i<=1016; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); } #define MATRIMBLFIX(i) (i^(BITSWAP8(i&0x3,4,3,1,2,0,7,6,5)<<8)) DRIVER_INIT( matrimbl ) { UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); int i; int j=0; int tx_size = memory_region_length(REGION_GFX1); int rom_size = memory_region_length(REGION_GFX3); unsigned int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; if (dst){ memcpy(dst,src,0x400000); for(i=0;i<8;++i){ memcpy(src+i*0x80000,dst+sec[i],0x80000); } free(dst); } matrimbl_c(0); src = memory_region(REGION_GFX3)+rom_size-tx_size; 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)]; neogeo_fix_bank_type = 2; src = memory_region(REGION_CPU2)+0x10000; dst = (UINT8*)malloc(0x20000); memcpy(dst,src,0x20000); for(i=0x00000;i<0x20000;i++){ if (i&0x10000){ if (i&0x800){ j=MATRIMBLFIX(i); j=j^0x10000; }else{ j=MATRIMBLFIX((i^0x01)); } }else{ if (i&0x800){ j=MATRIMBLFIX((i^0x01)); j=j^0x10000; }else{ j=MATRIMBLFIX(i); } } src[j]=dst[i]; } free(dst); memcpy(src-0x10000,src,0x10000); init_neogeo(); } GAMEB( 2002, matrimbl, matrim, neogeo, raster, neogeo, matrimbl, ROT0, "Bootleg", "Matrimelee (Bootleg)", 0 ) Then in Machine\neogeo.c after static void neogeo_custom_memory(void) if (!strcmp(Machine->gamedrv->name,"matrim") || !strcmp(Machine->gamedrv->name,"matrimd") || !strcmp(Machine->gamedrv->name,"matrimbl")) { /* the game hangs after a while without this patch */ UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1); mem16[0x310 >> 1] = 0x4e71; mem16[0x318 >> 1] = 0x4e71; /* Patch out loop to disable console mode */ mem16[0x1050 >> 1] = 0x4e75; }
  6. Works fine on Windows Xp SP2
  7. ROM_START( kf2k4spe ) ROM_REGION( 0x500000, REGION_CPU1, 0 ) 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) ) ROM_LOAD16_WORD_SWAP( "k2k4s-p1.bin", 0x100000, 0x400000, CRC(e6c50566) SHA1(cc6a3489a3bfeb4dcc65b6ddae0030f7e66fbabe) ) NEO_SFIX_128K( "k2k4s-s1.bin", CRC(a3c9b2d8) SHA1(1472d2cbd7bb73e84824ecf773924007e6117e77) ) NEO_BIOS_SOUND_128K( "k2k4s-m1.bin", CRC(60ba7947) SHA1(061141463fe59c5e0d4cf81d28a09b0b5d9c1566) ) ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY ) ROM_LOAD( "k2k4s-v2.bin", 0x000000, 0x800000, CRC(e4ddfb3f) SHA1(eb8220ab01c16cf9244b7f3f9912bec0db561b85) ) ROM_LOAD( "k2k4s-v1.bin", 0x800000, 0x800000, CRC(b887d287) SHA1(f593a5722df6f6fac023d189a739a117e976bb2f) ) 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 DRIVER_INIT( kf2k4spe ) { int i; UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); unsigned int sec[] = {0x300000,0x200000,0x100000,0x000000}; if (dst) { memcpy(dst,src,0x400000); for (i = 0; i < 4; ++i) { memcpy(src+i*0x100000,dst+sec[i],0x100000); } free(dst); } init_neogeo(); } GAMEB( 2004, kf2k4spe, kof2002, neogeo, raster, neogeo, kf2k4spe, ROT0, "Eolith / Playmore Corporation", "The King of Fighters 2004 Special Edition (Hack)", 0 )
  8. There is no version like that. If you want one that does that then you have to use the older versions whch are not EGCG.
  9. No problem robbert If you need more info just ask me and I will see what I can do
  10. I want to make my own
  11. Even Robbert is getting into it and he only has 500mhz PC.
  12. Nah its not that hard to sort out
  13. Some of the code was changed I will post all the init here and you can pick the ones you need /* Clone Mame Extra Games Code */ DRIVER_INIT( kof2002 ) { int i; unsigned int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); if (dst) { memcpy( dst, src, 0x400000 ); for( i=0; i<8; ++i ) { memcpy( src+i*0x80000, dst+sec[i], 0x80000 ); } free(dst); } neo_pcm2_playmore_2002(0); // kof2002 neogeo_fix_bank_type = 0; kof2000_neogeo_gfx_decrypt(0xec); init_neogeo(); } DRIVER_INIT( samsho5 ) { /* Descrambling P ROMs */ UINT8 *src = memory_region(REGION_CPU1); UINT8 *dst = malloc(0x800000); int i; unsigned int sec[]={0x000000, 0x080000, 0x700000, 0x680000, 0x500000, 0x180000, 0x200000, 0x480000, 0x300000, 0x780000, 0x600000, 0x280000, 0x100000, 0x580000, 0x400000, 0x380000}; if (dst) { memcpy(dst,src,0x800000); for(i=0;i<16;++i) { memcpy(src+i*0x80000,dst+sec[i],0x80000); } free(dst); } neogeo_fix_bank_type = 1; kof2000_neogeo_gfx_decrypt(0x0f); neo_pcm2_playmore_2002(3); // samsho5 init_neogeo(); } DRIVER_INIT( samsh5nd ) { /* Descrambling P ROMs */ UINT8 *src = memory_region(REGION_CPU1); UINT8 *dst = malloc(0x800000); int i; unsigned int sec[]={0x000000, 0x080000, 0x700000, 0x680000, 0x500000, 0x180000, 0x200000, 0x480000, 0x300000, 0x780000, 0x600000, 0x280000, 0x100000, 0x580000, 0x400000, 0x380000}; if (dst) { memcpy(dst,src,0x800000); for(i=0;i<16;++i) { memcpy(src+i*0x80000,dst+sec[i],0x80000); } free(dst); } init_neogeo(); } DRIVER_INIT( samsh5sp ) { /* Descrambling Px by Vorador from speksnk Converted to Mame code by James */ UINT8 *src = memory_region(REGION_CPU1); UINT8 *dst = malloc(0x800000); int i; unsigned int sec[]={0x0,0x1,0xA,0x9,0xC,0xB,0xE,0x5,0x2,0xD,0x8,0xF,0x4,0x7,0x6,0x3}; if (dst) { memcpy(dst,src,0x800000); for(i=0;i<0x10;i++) { memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000); } free(dst); } neogeo_fix_bank_type = 1; kof2000_neogeo_gfx_decrypt(0x0d); neo_pcm2_playmore_2002(6); // samsh5sp init_neogeo(); } static void kof2003_sx_decrypt( void ) { int i; int tx_size = memory_region_length( REGION_GFX1 ); int rom_size = memory_region_length( REGION_GFX3 ); UINT8 *src; UINT8 *dst; src = memory_region( REGION_GFX3 ) + rom_size - 0x1000000 - 0x80000; dst = memory_region( REGION_GFX1 ); for( i = 0; i < tx_size / 2; i++ ){ dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ]; } src = memory_region( REGION_GFX3 ) + rom_size - 0x80000; dst = memory_region( REGION_GFX1 ) + 0x80000; for( i = 0; i < tx_size / 2; i++ ){ dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ]; } dst = memory_region( REGION_GFX1 ); for( i = 0; i < tx_size; i++ ){ dst[ i ] = BITSWAP8( dst[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 ); } } DRIVER_INIT( kof2003 ) { const unsigned char xor2[ 0x20 ] = { 0xb4, 0x0f, 0x40, 0x6c, 0x38, 0x07, 0xd0, 0x3f, 0x53, 0x08, 0x80, 0xaa, 0xbe, 0x07, 0xc0, 0xfa, 0xd0, 0x08, 0x10, 0xd2, 0xf1, 0x03, 0x70, 0x7e, 0x87, 0x0B, 0x40, 0xf6, 0x2a, 0x0a, 0xe0, 0xf9 }; int i; int ofst; UINT8 *rom, *buf; rom = memory_region( REGION_CPU1 ); 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, 4, 5, 6, 7, 8, 9, 10, 11, 3, 2, 1, 0 ); } buf = malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); 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) ^ 0x00300) + (BITSWAP8( ((i & 0x0ff000) >> 12), 4, 5, 6, 7, 1, 0, 3, 2 ) << 12); memcpy( &rom[ i ], &buf[ ofst ], 0x100 ); } free( buf ); buf = malloc(0x900000); memcpy( buf, rom, 0x900000 ); memcpy( &rom[0x100000], &buf[0x800000], 0x100000 ); memcpy( &rom[0x200000], &buf[0x100000], 0x700000 ); free(buf); kof2003_sx_decrypt(); neogeo_fix_bank_type = 2; neo_pcm2_playmore_2002(5); // Kof2003 init_neogeo(); } DRIVER_INIT( kof2003a ) { kof2003_sx_decrypt(); neogeo_fix_bank_type = 2; init_neogeo(); } DRIVER_INIT( kof2003p ) { neogeo_fix_bank_type = 2; init_neogeo(); } DRIVER_INIT( pnyaa ) { neogeo_fix_bank_type = 1; kof2000_neogeo_gfx_decrypt(0x2e); neo_pcm2_snk_1999(4); init_neogeo(); } DRIVER_INIT( matrim ) { UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); int i; unsigned int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; if (dst) { memcpy(dst,src,0x400000); for(i=0;i<8;++i) { memcpy(src+i*0x80000,dst+sec[i],0x80000); } free(dst); } neogeo_fix_bank_type = 2; kof2000_neogeo_gfx_decrypt(0x6a); neo_pcm2_playmore_2002(1); // Matrim init_neogeo(); } DRIVER_INIT( matrimnd ) { UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); int i; unsigned int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; if (dst) { memcpy(dst,src,0x400000); for(i=0;i<8;++i) { memcpy(src+i*0x80000,dst+sec[i],0x80000); } free(dst); } neogeo_fix_bank_type = 2; /* the S data comes from the end of the C data */ { int i; int tx_size = memory_region_length(REGION_GFX1); int rom_size = memory_region_length(REGION_GFX3); 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)]; } neo_pcm2_playmore_2002(1); // Matrim init_neogeo(); } /* descrambling information from razoola */ static void matrimbl_neogeo_gfx_address_fix_do(int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift) { int i,j; int tilesize=128; UINT8* rom = (UINT8*)malloc(16*tilesize); // 16 tiles buffer UINT8* realrom = memory_region(REGION_GFX3) + start*tilesize; for (i = 0; i < (end-start)/16; i++) { for (j = 0; j < 16; j++) { int offset = (((j&1)>>0)<<bit0shift) +(((j&2)>>1)<<bit1shift) +(((j&4)>>2)<<bit2shift) +(((j&8)>>3)<<bit3shift); memcpy(rom+j*tilesize, realrom+offset*tilesize, tilesize); } memcpy(realrom,rom,tilesize*16); realrom+=16*tilesize; } free(rom); } static void matrimbl_neogeo_gfx_address_fix(int start, int end) { matrimbl_neogeo_gfx_address_fix_do(start+512*0, end+512*0, 0,3,2,1); matrimbl_neogeo_gfx_address_fix_do(start+512*1, end+512*1, 1,0,3,2); matrimbl_neogeo_gfx_address_fix_do(start+512*2, end+512*2, 2,1,0,3); // skip 3 & 4 matrimbl_neogeo_gfx_address_fix_do(start+512*5, end+512*5, 0,1,2,3); matrimbl_neogeo_gfx_address_fix_do(start+512*6, end+512*6, 0,1,2,3); matrimbl_neogeo_gfx_address_fix_do(start+512*7, end+512*7, 0,2,3,1); } static void matrimbl_c(int pow) { int i; for (i=0; i<=192; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=200; i<=392; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=400; i<=592; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=600; i<=792; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=800; i<=992; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); for (i=1000; i<=1016; i+=8) matrimbl_neogeo_gfx_address_fix(i*512,i*512+512); } #define MATRIMBLFIX(i) (i^(BITSWAP8(i&0x3,4,3,1,2,0,7,6,5)<<8)) DRIVER_INIT( matrimbl ) { UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); int i; int j=0; int tx_size = memory_region_length(REGION_GFX1); int rom_size = memory_region_length(REGION_GFX3); unsigned int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; if (dst){ memcpy(dst,src,0x400000); for(i=0;i<8;++i){ memcpy(src+i*0x80000,dst+sec[i],0x80000); } free(dst); } matrimbl_c(0); src = memory_region(REGION_GFX3)+rom_size-tx_size; 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)]; neogeo_fix_bank_type = 2; src = memory_region(REGION_CPU2)+0x10000; dst = (UINT8*)malloc(0x20000); memcpy(dst,src,0x20000); for(i=0x00000;i<0x20000;i++){ if (i&0x10000){ if (i&0x800){ j=MATRIMBLFIX(i); j=j^0x10000; }else{ j=MATRIMBLFIX((i^0x01)); } }else{ if (i&0x800){ j=MATRIMBLFIX((i^0x01)); j=j^0x10000; }else{ j=MATRIMBLFIX(i); } } src[j]=dst[i]; } free(dst); memcpy(src-0x10000,src,0x10000); init_neogeo(); } 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; UINT8 *rom, *buf; rom = memory_region( REGION_CPU1 ); 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 ); } buf = malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); 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 ); } free( buf ); buf = malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); memcpy( &rom[ 0x100000 ], &buf[ 0x700000 ], 0x100000 ); memcpy( &rom[ 0x200000 ], &buf[ 0x100000 ], 0x600000 ); free( buf ); } static void svcchaos_gfx_decrypt( void ) { const unsigned char xor1[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9, }; int i; int ofst; UINT8 *src = memory_region( REGION_GFX3 ); int len = memory_region_length( REGION_GFX3 ); UINT8 *dst = malloc( len ); UINT8 *s1 = memory_region( REGION_GFX1 ); size_t s1_size = memory_region_length( REGION_GFX1 ); for( i = 0; i < len; i++ ){ src[ i ] ^= xor1[ (i % 4) ]; } for( i = 0; i < len; i += 4 ){ UINT32 *src32 = (UINT32*)&src[ i ]; *src32 = BITSWAP32( *src32, 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( dst, src, len ); for( i = 0; i < len / 4; i++ ){ ofst = BITSWAP24( (i & 0x1fffff), 0x17, 0x16, 0x15, 0x04, 0x0b, 0x0e, 0x08, 0x0c, 0x10, 0x00, 0x0a, 0x13, 0x03, 0x06, 0x02, 0x07, 0x0d, 0x01, 0x11, 0x09, 0x14, 0x0f, 0x12, 0x05 ); ofst ^= 0x0c8923; ofst += (i & 0xffe00000); memcpy( &src[ i * 4 ], &dst[ ofst * 4 ], 0x04 ); } free( dst ); kof2000_neogeo_gfx_decrypt(0x57); for( i = 0; i < s1_size; i++ ){ s1[ i ] = BITSWAP8( s1[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 ); } } DRIVER_INIT( svcchaos ) { neogeo_fix_bank_type = 2; svcchaos_px_decrypt(); svcchaos_gfx_decrypt(); neo_pcm2_playmore_2002(4); // Svcchaos, Svchaosa init_neogeo(); } DRIVER_INIT( svchaosa ) { svcchaos_px_decrypt(); neo_pcm2_playmore_2002(4); // Svcchaos, Svchaosa neogeo_fix_bank_type = 2; kof2000_neogeo_gfx_decrypt(0x57); init_neogeo(); } static void svcboot_px_decrypt( void ) { const unsigned char sec[] = { 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; int i; int size = memory_region_length( REGION_CPU1 ); UINT8 *src = memory_region( REGION_CPU1 ); UINT8 *dst = malloc( size ); int ofst; for( i = 0; i < size / 0x100000; i++ ){ memcpy( &dst[ i * 0x100000 ], &src[ sec[ i ] * 0x100000 ], 0x100000 ); } for( i = 0; i < size / 2; i++ ){ ofst = BITSWAP8( (i & 0x0000ff), 7, 6, 1, 0, 3, 2, 5, 4 ); ofst += (i & 0xffff00); memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 ); } free( dst ); } static void svcboot_cx_decrypt( void ) { const unsigned char idx_tbl[ 0x10 ] = { 0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, }; const unsigned char bitswap4_tbl[ 6 ][ 4 ] = { { 3, 0, 1, 2 }, { 2, 3, 0, 1 }, { 1, 2, 3, 0 }, { 0, 1, 2, 3 }, { 3, 2, 1, 0 }, { 3, 0, 2, 1 }, }; int i; int size = memory_region_length( REGION_GFX3 ); UINT8 *src = memory_region( REGION_GFX3 ); UINT8 *dst = malloc( size ); int ofst; memcpy( dst, src, size ); for( i = 0; i < size / 0x80; i++ ){ int idx = idx_tbl[ (i & 0xf00) >> 8 ]; int bit0 = bitswap4_tbl[ idx ][ 0 ]; int bit1 = bitswap4_tbl[ idx ][ 1 ]; int bit2 = bitswap4_tbl[ idx ][ 2 ]; int bit3 = bitswap4_tbl[ idx ][ 3 ]; ofst = BITSWAP8( (i & 0x0000ff), 7, 6, 5, 4, bit3, bit2, bit1, bit0 ); ofst += (i & 0xfffff00); memcpy( &src[ i * 0x80 ], &dst[ ofst * 0x80 ], 0x80 ); } free( dst ); } static void svcplus_px_decrypt( void ) { int sec[] = { 0x00, 0x03, 0x02, 0x05, 0x04, 0x01 }; int size = memory_region_length( REGION_CPU1 ); UINT8 *src = memory_region( REGION_CPU1 ); UINT8 *dst = malloc( size ); int i; int ofst; memcpy( dst, src, size ); for( i = 0; i < size / 2; i++ ){ ofst = BITSWAP24( (i & 0xfffff), 0x17, 0x16, 0x15, 0x14, 0x13, 0x00, 0x01, 0x02, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x10, 0x11, 0x12 ); ofst ^= 0x0f0007; ofst += (i & 0xff00000); memcpy( &src[ i * 0x02 ], &dst[ ofst * 0x02 ], 0x02 ); } memcpy( dst, src, size ); for( i = 0; i < 6; i++ ){ memcpy( &src[ i * 0x100000 ], &dst[ sec[ i ] * 0x100000 ], 0x100000 ); } free( dst ); } static void svcplus_sx_decrypt( void ) { int i; // move this outside of the "for" loop int rom_size = memory_region_length( REGION_GFX1 ); UINT8 *rom = memory_region( REGION_GFX1 ); UINT8 *buf = malloc( rom_size ); memcpy( buf, rom, rom_size ); for( i = 0; i < rom_size; i += 0x10 ){ // notice removal of "int i =0" memcpy( &rom[ i ], &buf[ i + 0x08 ], 0x08 ); memcpy( &rom[ i + 0x08 ], &buf[ i ], 0x08 ); } free( buf ); } static void svcplusa_px_decrypt( void ) { int sec[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; int i; // move this outside of the "for" loop int rom_size = memory_region_length( REGION_CPU1 ); UINT8 *rom = memory_region( REGION_CPU1 ); UINT8 *buf = malloc( rom_size ); memcpy( buf, rom, rom_size ); for( i = 0; i < 6; i++ ){ // notice removal of "int i = 0" memcpy( &rom[ i * 0x100000 ], &buf[ sec[ i ] * 0x100000 ], 0x100000 ); } free( buf ); } static void svcsplus_px_decrypt( void ) { int sec[] = { 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; int size = memory_region_length( REGION_CPU1 ); UINT8 *src = memory_region( REGION_CPU1 ); UINT8 *dst = malloc( size ); int i; int ofst; memcpy( dst, src, size ); for (i = 0; i < size / 2; i++ ){ ofst = BITSWAP16( (i & 0x007fff), 0x0f, 0x00, 0x08, 0x09, 0x0b, 0x0a, 0x0c, 0x0d, 0x04, 0x03, 0x01, 0x07, 0x06, 0x02, 0x05, 0x0e ); ofst += (i & 0x078000); ofst += sec[ (i & 0xf80000) >> 19 ] << 19; memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 ); } free( dst ); } static void svcsplus_sx_decrypt( void ) { int i; // move this outside of the "for" loop UINT8 *rom = memory_region( REGION_GFX1 ); int rom_size = memory_region_length( REGION_GFX1 ); for( i = 0; i < rom_size; i++ ){// notice removal of "int i = 0" rom[ i ] = BITSWAP8( rom[ i ], 7, 6, 0, 4, 3, 2, 1, 5 ); } } static void svcsplus_px_patch( void ) { UINT16 *prom = (UINT16*)memory_region(REGION_CPU1); prom[0x9e90/2] = 0x000f; prom[0x9e92/2] = 0xc9c0; prom[0xa10c/2] = 0x4eb9; prom[0xa10e/2] = 0x000e; prom[0xa110/2] = 0x9750; } DRIVER_INIT( svcboot ) { svcboot_px_decrypt(); svcboot_cx_decrypt(); init_neogeo(); } DRIVER_INIT( svcplus ) { svcplus_px_decrypt(); svcboot_cx_decrypt(); svcplus_sx_decrypt(); init_neogeo(); } DRIVER_INIT( svcplusa ) { svcplusa_px_decrypt(); svcboot_cx_decrypt(); init_neogeo(); } DRIVER_INIT( svcsplus ) { svcsplus_px_decrypt(); svcsplus_sx_decrypt(); svcboot_cx_decrypt(); svcsplus_px_patch(); init_neogeo(); } DRIVER_INIT( svcrmu ) { neogeo_fix_bank_type = 2; init_neogeo(); } static void mslug5_px_decrypt( void ) { 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; UINT8 *rom, *buf; int ofst; rom = memory_region( REGION_CPU1 ); 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 < 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 ); } buf = malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); 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 ); } free( buf ); buf = malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); memcpy( &rom[ 0x100000 ], &buf[ 0x700000 ], 0x100000 ); memcpy( &rom[ 0x200000 ], &buf[ 0x100000 ], 0x600000 ); free( buf ); } DRIVER_INIT( mslug5 ) { mslug5_px_decrypt(); neo_pcm2_playmore_2002(2); // Mslug5 neogeo_fix_bank_type = 1; kof2000_neogeo_gfx_decrypt(0x19); init_neogeo(); } DRIVER_INIT( mslug5nd ) { /* the S data comes from the end of the C data */ { int i; int tx_size = memory_region_length(REGION_GFX1); int rom_size = memory_region_length(REGION_GFX3); 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)]; } mslug5_px_decrypt(); init_neogeo(); } DRIVER_INIT( ms5plus ) { UINT8 *dst = malloc(0x20000); UINT8 *roms1 = (memory_region(REGION_GFX1)); int j; if ( dst ) { memcpy(dst,roms1,0x20000); 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; kof2000_neogeo_gfx_decrypt(0x19); init_neogeo(); } DRIVER_INIT( kf2k4spe ) { int i; UINT8 *src = memory_region(REGION_CPU1)+0x100000; UINT8 *dst = malloc(0x400000); unsigned int sec[] = {0x300000,0x200000,0x100000,0x000000}; if (dst) { memcpy(dst,src,0x400000); for (i = 0; i < 4; ++i) { memcpy(src+i*0x100000,dst+sec[i],0x100000); } free(dst); } init_neogeo(); } /* kof10th Bankswitch */ static UINT16 neogeo_sram16_2[0x2000]; READ16_HANDLER( neogeo_sram16_2_r ) { return neogeo_sram16_2[offset]; } WRITE16_HANDLER( neogeo_sram16_2_w ) { COMBINE_DATA(&neogeo_sram16_2[offset]); } DRIVER_INIT( kof10th ) { int i,j; UINT16 *prom = (UINT16*)memory_region(REGION_CPU1); UINT16 *buf = (UINT16*)malloc(0x800000); UINT16 *srom = (UINT16*)memory_region(REGION_GFX1); if (buf){ memcpy(buf,prom,0x800000); for(i=0;i<0x800000/2;i++){ j=BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,1,8,7,6,0,4,3,2,9,5); prom[j]=buf[i]; } free(buf); } // get 8x8 tiles from P rom // bank 1, game does this on the fly! for (i=0;i<0x10000/2;i++){ srom[i+0x00000/2]=BITSWAP16(prom[i+0x600000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13); srom[i+0x10000/2]=BITSWAP16(prom[i+0x6d0000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13); } for (i=0;i<0x4000/2;i++){ srom[i+0x02000/2]=BITSWAP16(prom[i+0x6c2000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13); srom[i+0x12000/2]=BITSWAP16(prom[i+0x612000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13); } // bank 2, game does this on the fly! for (i=0;i<0x20000/2;i++){ srom[i+0x40000/2]=BITSWAP16(prom[i+0x600000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13); srom[i+0x60000/2]=srom[i+0x20000/2]; // copy bios again } // Altera protection chip patches these over P ROM prom[0x00124/2] = 0x000d; // Run code that gives XOR for RAM moves and forces SoftDIPs prom[0x00126/2] = 0xf7a8; // (how to play off and always teamplay). Also forces USA region. prom[0x08bf4/2] = 0x4ef9; // Run code to change 8x8 tiles (needed for neogeo logo tiles) prom[0x08bf6/2] = 0x000d; prom[0x08bf8/2] = 0xf980; // remove protection (game has ram mapped to 0xe0000 and 0xf0000 and moves code into it) for(i=0;i<0x40;i++){ prom[0xe0000/2+i]=((prom[0x531680/2+i]^(0xc11d-0xc0c8))^prom[0x531600/2+i]); } for(i=0;i<0x270;i++){ prom[0xe1000/2+i]=((prom[0x531970/2+i]^(0xc11d-0xc0d9))^prom[0x531700/2+i]); } prom[0xe1154/2] = 0x125c; // fix a jmp offset (was in 0xe0000 range) prom[0xdf986/2] = 0x168C; // fix a bsr offset (was in 0xe0000 range) prom[0xdf998/2] = 0x1668; // fix a bsr offset (was in 0xe0000 range) prom[0xdd880/2] = 0x4e75; // fix level drawing (from 0xf0000 range) prom[0xdd89e/2] = 0x4e75; // fix level anim (from 0xf0000 range) prom[0xdd8bc/2] = 0x4e75; // fix continue screen (from 0xf0000 range) neogeo_fix_bank_type = 0; /* kof10th Bankswitch handler */ memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000,0x2fffff, 0, 0, neogeo_sram16_2_r); memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000,0x2fffff, 0, 0, neogeo_sram16_2_w); memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ffff0,0x2fffff, 0, 0, neo_bankswitch_w); init_neogeo(); } /* descrambling information from razoola */ /* descrambling S rom for cthd2003 Super Plus */ static void ct2k3sp_sx_decrypt( void ) { int rom_size = memory_region_length( REGION_GFX1 ); UINT8 *rom = memory_region( REGION_GFX1 ); UINT8 *buf = malloc( rom_size ); int i; int ofst; memcpy( buf, rom, rom_size ); for( i = 0; i < rom_size; i++ ){ ofst = BITSWAP24( (i & 0x1ffff), 23, 22, 21, 20, 19, 18, 17, 3, 0, 1, 4, 2, 13, 14, 16, 15, 5, 6, 11, 10, 9, 8, 7, 12 ); ofst += (i >> 17) << 17; rom[ i ] = buf[ ofst ]; } memcpy( buf, rom, rom_size ); memcpy( &rom[ 0x08000 ], &buf[ 0x10000 ], 0x8000 ); memcpy( &rom[ 0x10000 ], &buf[ 0x08000 ], 0x8000 ); memcpy( &rom[ 0x28000 ], &buf[ 0x30000 ], 0x8000 ); memcpy( &rom[ 0x30000 ], &buf[ 0x28000 ], 0x8000 ); free( buf ); } static void cthd2003_neogeo_gfx_address_fix_do(int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift) { int i,j; int tilesize=128; UINT8* rom = (UINT8*)malloc(16*tilesize); // 16 tiles buffer UINT8* realrom = memory_region(REGION_GFX3) + start*tilesize; for (i = 0; i < (end-start)/16; i++) { for (j = 0; j < 16; j++) { int offset = (((j&1)>>0)<<bit0shift) +(((j&2)>>1)<<bit1shift) +(((j&4)>>2)<<bit2shift) +(((j&8)>>3)<<bit3shift); memcpy(rom+j*tilesize, realrom+offset*tilesize, tilesize); } memcpy(realrom,rom,tilesize*16); realrom+=16*tilesize; } free(rom); } static void cthd2003_neogeo_gfx_address_fix(int start, int end) { cthd2003_neogeo_gfx_address_fix_do(start+512*0, end+512*0, 0,3,2,1); cthd2003_neogeo_gfx_address_fix_do(start+512*1, end+512*1, 1,0,3,2); cthd2003_neogeo_gfx_address_fix_do(start+512*2, end+512*2, 2,1,0,3); // skip 3 & 4 cthd2003_neogeo_gfx_address_fix_do(start+512*5, end+512*5, 0,1,2,3); cthd2003_neogeo_gfx_address_fix_do(start+512*6, end+512*6, 0,1,2,3); cthd2003_neogeo_gfx_address_fix_do(start+512*7, end+512*7, 0,2,3,1); } static void cthd2003_c(int pow) { int i; for (i=0; i<=192; i+=8) cthd2003_neogeo_gfx_address_fix(i*512,i*512+512); for (i=200; i<=392; i+=8) cthd2003_neogeo_gfx_address_fix(i*512,i*512+512); for (i=400; i<=592; i+=8) cthd2003_neogeo_gfx_address_fix(i*512,i*512+512); for (i=600; i<=792; i+=8) cthd2003_neogeo_gfx_address_fix(i*512,i*512+512); for (i=800; i<=992; i+=8) cthd2003_neogeo_gfx_address_fix(i*512,i*512+512); for (i=1000; i<=1016; i+=8) cthd2003_neogeo_gfx_address_fix(i*512,i*512+512); } DRIVER_INIT (cthd2003) { UINT8 *romdata = memory_region(REGION_GFX1); UINT8*tmp = (UINT8*)malloc(8*128*128); memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128); memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128); memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128); memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128); memcpy(romdata, tmp, 8*128*128); romdata = memory_region(REGION_CPU2)+0x10000; memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128); memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128); memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128); memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128); memcpy(romdata, tmp, 8*128*128); free(tmp); memcpy(romdata-0x10000,romdata,0x10000); cthd2003_c(0); init_neogeo(); } DRIVER_INIT (ct2k3sp) { UINT8 *romdata = memory_region(REGION_CPU2)+0x10000; UINT8*tmp = (UINT8*)malloc(8*128*128); memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128); memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128); memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128); memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128); memcpy(romdata, tmp, 8*128*128); free(tmp); memcpy(romdata-0x10000,romdata,0x10000); ct2k3sp_sx_decrypt(); cthd2003_c(0); init_neogeo(); }
  14. Good luck with that
  15. lol zintrkcd(Razoola's CD to MVS conversion) I had that in my build for a very long time now. There are two known Mame plus builds which are Intel CPU and Generic i686 CPU
  16. ThunderMame The source also has the newer games kof2003 etc. Its a very old build as well. It has always been v68 it only gets games added from time to time. No core changes. Go ask the MameDev if in doubt. Even Mameplus does not have that added for that reason,
  17. Please post the errors here if you can
  18. In response to this line. and if there's a good reason, the original site as well. No if's or buts the original site gets credit as well
  19. Neither was I
  20. Yes true for some . But I rather encrypted sets You no longer need to add code to common.h since that code is now offically supported.
  21. Works here on Nebula 2.25
  22. Thanks for your input on things Keith I do see where you are comming from. Its good to get an understanding on the matter.
  23. Myabe we need more news posters. That stick to the emulation that they know about and keep track of those sites. I know there are plenty for the likes of Mame but there is many other emulation news we need posters for. On another note : I know Gamecop is working very hard on his site. and has come very far with it as well So lets all give GC a big thanks for all his efforts. Without GC and others we would not have a cool place like 1emulation to visit.
  24. This is why I stick to what I know and keep track of. Which is Mame. If I find anything else to post about it always comes from the original emulation site..By doing this it avoids problems.
  25. So you go to bed when the sun goes down ? I go to bed when the clock says 11pm .
×
×
  • Create New...