Author Topic: kof2002b driver  (Read 4704 times)

Offline robber804

  • Newbies
  • *
  • Posts: 40
  • Karma: +0/-0
  • Relentless Bastard
kof2002b driver
« on: January 29, 2005, 01:44:41 AM »
converted from iq_132's FBA driver here is the MAME driver

Code: [Select]


ROM_START( kof2002b ) /* bootleg */
ROM_REGION( 0x500000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "265-p1.bin", 0x000000, 0x100000, CRC(9ede7323) SHA1(AD9D45498777FDA9FA58E75781F48E09AEE705A6) )
ROM_LOAD16_WORD_SWAP( "265-p2b.bin", 0x100000, 0x400000, CRC(6dbee4df) SHA1(9a9646c81b233b44213c624b898c19f83e9a07f8) )

NEO_SFIX_128K( "265-s1b.bin", CRC(2255f5bf) )

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

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
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( "265-c1b.bin", 0x0000000, 0x800000, CRC(f25d3d66) )
ROM_LOAD16_BYTE( "265-c2b.bin", 0x0000001, 0x800000, CRC(e3e66f1d) )
ROM_LOAD16_BYTE( "265-c3b.bin", 0x1000000, 0x800000, CRC(8732fa30) )
ROM_LOAD16_BYTE( "265-c4b.bin", 0x1000001, 0x800000, CRC(0989fd40) )
ROM_LOAD16_BYTE( "265-c5b.bin", 0x2000000, 0x800000, CRC(60635cd2) )
ROM_LOAD16_BYTE( "265-c6b.bin", 0x2000001, 0x800000, CRC(bd736824) )
ROM_LOAD16_BYTE( "265-c7b.bin", 0x3000000, 0x800000, CRC(2da8d8cf) )
ROM_LOAD16_BYTE( "265-c8b.bin", 0x3000001, 0x800000, CRC(2048404a) )
ROM_END

void kof2002b_px_decrypt()
{      
       
int sec[] = { 0x02, 0x05, 0x06, 0x03, 0x00, 0x07, 0x04, 0x01 };

int i, rom_size = 0x400000;
UINT8 *src = memory_region(REGION_CPU1)+0x100000;
UINT8 *dst = malloc( rom_size );
 
memcpy( dst, src, rom_size);
for( i=0; i<8; i++){
memcpy( src+i*0x80000, dst+sec[i]*0x80000, 0x80000);
}
free( dst );            
}

void kof2002b_gfx_decrypt( void )
{
const unsigned int kof2002b_sec[512] = {
0x001, 0x101, 0x002, 0x102, 0x003, 0x103, 0x004, 0x104, 0x009, 0x089, 0x109, 0x189, 0x00A, 0x08A, 0x10A, 0x18A,
0x011, 0x051, 0x091, 0x0D1, 0x111, 0x151, 0x191, 0x1D1, 0x019, 0x01D, 0x059, 0x05D, 0x099, 0x09D, 0x0D9, 0x0DD,
0x021, 0x023, 0x025, 0x027, 0x061, 0x063, 0x065, 0x067, 0x029, 0x129, 0x0A9, 0x1A9, 0x069, 0x169, 0x0E9, 0x1E9,
0x031, 0x071, 0x0B1, 0x0F1, 0x131, 0x171, 0x1B1, 0x1F1, 0x039, 0x0B9, 0x03A, 0x0BA, 0x03B, 0x0BB, 0x03C, 0x0BC,
0x005, 0x105, 0x006, 0x106, 0x007, 0x107, 0x008, 0x108, 0x00B, 0x08B, 0x10B, 0x18B, 0x00C, 0x08C, 0x10C, 0x18C,
0x012, 0x052, 0x092, 0x0D2, 0x112, 0x152, 0x192, 0x1D2, 0x119, 0x11D, 0x159, 0x15D, 0x199, 0x19D, 0x1D9, 0x1DD,
0x0A1, 0x0A3, 0x0A5, 0x0A7, 0x0E1, 0x0E3, 0x0E5, 0x0E7, 0x02D, 0x12D, 0x0AD, 0x1AD, 0x06D, 0x16D, 0x0ED, 0x1ED,
0x035, 0x075, 0x0B5, 0x0F5, 0x135, 0x175, 0x1B5, 0x1F5, 0x03D, 0x0BD, 0x03E, 0x0BE, 0x03F, 0x0BF, 0x040, 0x0C0,
0x041, 0x141, 0x042, 0x142, 0x043, 0x143, 0x044, 0x144, 0x00D, 0x08D, 0x10D, 0x18D, 0x00E, 0x08E, 0x10E, 0x18E,
0x013, 0x053, 0x093, 0x0D3, 0x113, 0x153, 0x193, 0x1D3, 0x01A, 0x01E, 0x05A, 0x05E, 0x09A, 0x09E, 0x0DA, 0x0DE,
0x121, 0x123, 0x125, 0x127, 0x161, 0x163, 0x165, 0x167, 0x02B, 0x12B, 0x0AB, 0x1AB, 0x06B, 0x16B, 0x0EB, 0x1EB,
0x033, 0x073, 0x0B3, 0x0F3, 0x133, 0x173, 0x1B3, 0x1F3, 0x079, 0x0F9, 0x07A, 0x0FA, 0x07B, 0x0FB, 0x07C, 0x0FC,
0x045, 0x145, 0x046, 0x146, 0x047, 0x147, 0x048, 0x148, 0x00F, 0x08F, 0x10F, 0x18F, 0x010, 0x090, 0x110, 0x190,
0x014, 0x054, 0x094, 0x0D4, 0x114, 0x154, 0x194, 0x1D4, 0x11A, 0x11E, 0x15A, 0x15E, 0x19A, 0x19E, 0x1DA, 0x1DE,
0x1A1, 0x1A3, 0x1A5, 0x1A7, 0x1E1, 0x1E3, 0x1E5, 0x1E7, 0x02F, 0x12F, 0x0AF, 0x1AF, 0x06F, 0x16F, 0x0EF, 0x1EF,
0x037, 0x077, 0x0B7, 0x0F7, 0x137, 0x177, 0x1B7, 0x1F7, 0x07D, 0x0FD, 0x07E, 0x0FE, 0x07F, 0x0FF, 0x080, 0x100,
0x081, 0x181, 0x082, 0x182, 0x083, 0x183, 0x084, 0x184, 0x049, 0x0C9, 0x149, 0x1C9, 0x04A, 0x0CA, 0x14A, 0x1CA,
0x015, 0x055, 0x095, 0x0D5, 0x115, 0x155, 0x195, 0x1D5, 0x01B, 0x01F, 0x05B, 0x05F, 0x09B, 0x09F, 0x0DB, 0x0DF,
0x022, 0x024, 0x026, 0x028, 0x062, 0x064, 0x066, 0x068, 0x02A, 0x12A, 0x0AA, 0x1AA, 0x06A, 0x16A, 0x0EA, 0x1EA,
0x032, 0x072, 0x0B2, 0x0F2, 0x132, 0x172, 0x1B2, 0x1F2, 0x139, 0x1B9, 0x13A, 0x1BA, 0x13B, 0x1BB, 0x13C, 0x1BC,
0x085, 0x185, 0x086, 0x186, 0x087, 0x187, 0x088, 0x188, 0x04B, 0x0CB, 0x14B, 0x1CB, 0x04C, 0x0CC, 0x14C, 0x1CC,
0x016, 0x056, 0x096, 0x0D6, 0x116, 0x156, 0x196, 0x1D6, 0x11B, 0x11F, 0x15B, 0x15F, 0x19B, 0x19F, 0x1DB, 0x1DF,
0x0A2, 0x0A4, 0x0A6, 0x0A8, 0x0E2, 0x0E4, 0x0E6, 0x0E8, 0x02E, 0x12E, 0x0AE, 0x1AE, 0x06E, 0x16E, 0x0EE, 0x1EE,
0x036, 0x076, 0x0B6, 0x0F6, 0x136, 0x176, 0x1B6, 0x1F6, 0x13D, 0x1BD, 0x13E, 0x1BE, 0x13F, 0x1BF, 0x140, 0x1C0,
0x0C1, 0x1C1, 0x0C2, 0x1C2, 0x0C3, 0x1C3, 0x0C4, 0x1C4, 0x04D, 0x0CD, 0x14D, 0x1CD, 0x04E, 0x0CE, 0x14E, 0x1CE,
0x017, 0x057, 0x097, 0x0D7, 0x117, 0x157, 0x197, 0x1D7, 0x01C, 0x020, 0x05C, 0x060, 0x09C, 0x0A0, 0x0DC, 0x0E0,
0x122, 0x124, 0x126, 0x128, 0x162, 0x164, 0x166, 0x168, 0x02C, 0x12C, 0x0AC, 0x1AC, 0x06C, 0x16C, 0x0EC, 0x1EC,
0x034, 0x074, 0x0B4, 0x0F4, 0x134, 0x174, 0x1B4, 0x1F4, 0x179, 0x1F9, 0x17A, 0x1FA, 0x17B, 0x1FB, 0x17C, 0x1FC,
0x0C5, 0x1C5, 0x0C6, 0x1C6, 0x0C7, 0x1C7, 0x0C8, 0x1C8, 0x04F, 0x0CF, 0x14F, 0x1CF, 0x050, 0x0D0, 0x150, 0x1D0,
0x018, 0x058, 0x098, 0x0D8, 0x118, 0x158, 0x198, 0x1D8, 0x11C, 0x120, 0x15C, 0x160, 0x19C, 0x1A0, 0x1DC, 0x1E0,
0x1A2, 0x1A4, 0x1A6, 0x1A8, 0x1E2, 0x1E4, 0x1E6, 0x1E8, 0x030, 0x130, 0x0B0, 0x1B0, 0x070, 0x170, 0x0F0, 0x1F0,
0x038, 0x078, 0x0B8, 0x0F8, 0x138, 0x178, 0x1B8, 0x1F8, 0x17D, 0x1FD, 0x17E, 0x1FE, 0x17F, 0x1FF, 0x180, 0x200,
};

UINT8 *dst = malloc(0x10000);
UINT8 *src = memory_region( REGION_GFX3 );
int size = memory_region_length( REGION_GFX3 );

for ( int i = 0; i < size; i+=0x10000)
{
memcpy(dst, src+i,0x10000);

for ( int j = 0; j < 512; ++j)
{
memcpy(src+i+(kof2002b_sec[j]-1)*128, dst+j*128, 128);
}
}
free(dst);

UINT8 *dst2 = malloc(0x10000);
UINT8 *src2 = memory_region( REGION_GFX1 );
int size2 = memory_region_length( REGION_GFX1 );

for ( int i = 0; i < size2; i+=0x10000)
{
memcpy(dst2, src2+i,0x10000);

for ( int j = 0; j < 512; ++j)
{
memcpy(src2+i+(kof2002b_sec[j]-1)*128, dst2+j*128, 128);
}
}
free(dst2);

}

void neo_pcm2_playmore_2002(int value)
{
        unsigned int addrs[7][2]={
/*0*/ {0x000000,0xa5000}, //kof2002
/*1*/ {0xffce20,0x01000}, //matrimelee    
/*2*/ {0xfe2cf6,0x4e001}, //mslug5
/*3*/ {0xfeb2c0,0x0a000}, //samsho5
/*4*/ {0xffac28,0xc2000}, //svcchaos
/*5*/ {0xff14ea,0xa7001}, //kof2003 0xa7001
/*6*/ {0xffb440,0x02000}, //samsh5sp
};
        unsigned int xor[7][8]={
                 {0xf9,0xe0,0x5d,0xf3,0xea,0x92,0xbe,0xef}, //kof2002
                 {0xc4,0x83,0xa8,0x5f,0x21,0x27,0x64,0xaf}, //matrimelee
                 {0xc3,0xfd,0x81,0xac,0x6d,0xe7,0xbf,0x9e}, //mslug5
                 {0xcb,0x29,0x7d,0x43,0xd2,0x3a,0xc2,0xb4}, //samsho5
                 {0xc3,0xfd,0x81,0xac,0x6d,0xe7,0xbf,0x9e}, //svcchaos
                 {0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}, //kof2003
                 {0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}, //samsh5sp
                 };

int rom_size = memory_region_length (REGION_SOUND1);
UINT8 *src = memory_region(REGION_SOUND1);
UINT8 *buf = malloc(0x1000000);

        memcpy(buf,src,rom_size);
       
        for (int i=0;i        {
            int ofst=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);
            ofst=ofst^addrs[value][1];
            int d=((i+addrs[value][0])&0xffffff);
            src[ofst]=buf[d]^xor[value][ofst&0x7];
        }
        free(buf);
}

DRIVER_INIT( kof2002b ){
kof2002b_px_decrypt();
kof2002b_gfx_decrypt();
neo_pcm2_playmore_2002(0);

neogeo_fix_bank_type = 0;
init_neogeo();
}

GAMEB( 2002, kof2002b, kof2002, neogeo, raster, neogeo,  kof2002b, ROT0, "Bootleg", "The King of Fighters 2002 (bootleg)" )
-robber804

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
kof2002b driver
« Reply #1 on: January 29, 2005, 04:34:56 AM »
This is the driver init I use

Code: [Select]

DRIVER_INIT( kof2002b )
{
int sec[] = { 0x02, 0x05, 0x06, 0x03, 0x00, 0x07, 0x04, 0x01 };

int i, rom_size = 0x400000;
UINT8 *src = memory_region(REGION_CPU1)+0x100000;
UINT8 *dst = malloc( rom_size );
 
memcpy( dst, src, rom_size);
for( i=0; i<8; i++){
memcpy( src+i*0x80000, dst+sec[i]*0x80000, 0x80000);
}
free( dst );
{
const unsigned int kof2002b_sec[512] = {
0x001, 0x101, 0x002, 0x102, 0x003, 0x103, 0x004, 0x104, 0x009, 0x089, 0x109, 0x189, 0x00A, 0x08A, 0x10A, 0x18A,
0x011, 0x051, 0x091, 0x0D1, 0x111, 0x151, 0x191, 0x1D1, 0x019, 0x01D, 0x059, 0x05D, 0x099, 0x09D, 0x0D9, 0x0DD,
0x021, 0x023, 0x025, 0x027, 0x061, 0x063, 0x065, 0x067, 0x029, 0x129, 0x0A9, 0x1A9, 0x069, 0x169, 0x0E9, 0x1E9,
0x031, 0x071, 0x0B1, 0x0F1, 0x131, 0x171, 0x1B1, 0x1F1, 0x039, 0x0B9, 0x03A, 0x0BA, 0x03B, 0x0BB, 0x03C, 0x0BC,
0x005, 0x105, 0x006, 0x106, 0x007, 0x107, 0x008, 0x108, 0x00B, 0x08B, 0x10B, 0x18B, 0x00C, 0x08C, 0x10C, 0x18C,
0x012, 0x052, 0x092, 0x0D2, 0x112, 0x152, 0x192, 0x1D2, 0x119, 0x11D, 0x159, 0x15D, 0x199, 0x19D, 0x1D9, 0x1DD,
0x0A1, 0x0A3, 0x0A5, 0x0A7, 0x0E1, 0x0E3, 0x0E5, 0x0E7, 0x02D, 0x12D, 0x0AD, 0x1AD, 0x06D, 0x16D, 0x0ED, 0x1ED,
0x035, 0x075, 0x0B5, 0x0F5, 0x135, 0x175, 0x1B5, 0x1F5, 0x03D, 0x0BD, 0x03E, 0x0BE, 0x03F, 0x0BF, 0x040, 0x0C0,
0x041, 0x141, 0x042, 0x142, 0x043, 0x143, 0x044, 0x144, 0x00D, 0x08D, 0x10D, 0x18D, 0x00E, 0x08E, 0x10E, 0x18E,
0x013, 0x053, 0x093, 0x0D3, 0x113, 0x153, 0x193, 0x1D3, 0x01A, 0x01E, 0x05A, 0x05E, 0x09A, 0x09E, 0x0DA, 0x0DE,
0x121, 0x123, 0x125, 0x127, 0x161, 0x163, 0x165, 0x167, 0x02B, 0x12B, 0x0AB, 0x1AB, 0x06B, 0x16B, 0x0EB, 0x1EB,
0x033, 0x073, 0x0B3, 0x0F3, 0x133, 0x173, 0x1B3, 0x1F3, 0x079, 0x0F9, 0x07A, 0x0FA, 0x07B, 0x0FB, 0x07C, 0x0FC,
0x045, 0x145, 0x046, 0x146, 0x047, 0x147, 0x048, 0x148, 0x00F, 0x08F, 0x10F, 0x18F, 0x010, 0x090, 0x110, 0x190,
0x014, 0x054, 0x094, 0x0D4, 0x114, 0x154, 0x194, 0x1D4, 0x11A, 0x11E, 0x15A, 0x15E, 0x19A, 0x19E, 0x1DA, 0x1DE,
0x1A1, 0x1A3, 0x1A5, 0x1A7, 0x1E1, 0x1E3, 0x1E5, 0x1E7, 0x02F, 0x12F, 0x0AF, 0x1AF, 0x06F, 0x16F, 0x0EF, 0x1EF,
0x037, 0x077, 0x0B7, 0x0F7, 0x137, 0x177, 0x1B7, 0x1F7, 0x07D, 0x0FD, 0x07E, 0x0FE, 0x07F, 0x0FF, 0x080, 0x100,
0x081, 0x181, 0x082, 0x182, 0x083, 0x183, 0x084, 0x184, 0x049, 0x0C9, 0x149, 0x1C9, 0x04A, 0x0CA, 0x14A, 0x1CA,
0x015, 0x055, 0x095, 0x0D5, 0x115, 0x155, 0x195, 0x1D5, 0x01B, 0x01F, 0x05B, 0x05F, 0x09B, 0x09F, 0x0DB, 0x0DF,
0x022, 0x024, 0x026, 0x028, 0x062, 0x064, 0x066, 0x068, 0x02A, 0x12A, 0x0AA, 0x1AA, 0x06A, 0x16A, 0x0EA, 0x1EA,
0x032, 0x072, 0x0B2, 0x0F2, 0x132, 0x172, 0x1B2, 0x1F2, 0x139, 0x1B9, 0x13A, 0x1BA, 0x13B, 0x1BB, 0x13C, 0x1BC,
0x085, 0x185, 0x086, 0x186, 0x087, 0x187, 0x088, 0x188, 0x04B, 0x0CB, 0x14B, 0x1CB, 0x04C, 0x0CC, 0x14C, 0x1CC,
0x016, 0x056, 0x096, 0x0D6, 0x116, 0x156, 0x196, 0x1D6, 0x11B, 0x11F, 0x15B, 0x15F, 0x19B, 0x19F, 0x1DB, 0x1DF,
0x0A2, 0x0A4, 0x0A6, 0x0A8, 0x0E2, 0x0E4, 0x0E6, 0x0E8, 0x02E, 0x12E, 0x0AE, 0x1AE, 0x06E, 0x16E, 0x0EE, 0x1EE,
0x036, 0x076, 0x0B6, 0x0F6, 0x136, 0x176, 0x1B6, 0x1F6, 0x13D, 0x1BD, 0x13E, 0x1BE, 0x13F, 0x1BF, 0x140, 0x1C0,
0x0C1, 0x1C1, 0x0C2, 0x1C2, 0x0C3, 0x1C3, 0x0C4, 0x1C4, 0x04D, 0x0CD, 0x14D, 0x1CD, 0x04E, 0x0CE, 0x14E, 0x1CE,
0x017, 0x057, 0x097, 0x0D7, 0x117, 0x157, 0x197, 0x1D7, 0x01C, 0x020, 0x05C, 0x060, 0x09C, 0x0A0, 0x0DC, 0x0E0,
0x122, 0x124, 0x126, 0x128, 0x162, 0x164, 0x166, 0x168, 0x02C, 0x12C, 0x0AC, 0x1AC, 0x06C, 0x16C, 0x0EC, 0x1EC,
0x034, 0x074, 0x0B4, 0x0F4, 0x134, 0x174, 0x1B4, 0x1F4, 0x179, 0x1F9, 0x17A, 0x1FA, 0x17B, 0x1FB, 0x17C, 0x1FC,
0x0C5, 0x1C5, 0x0C6, 0x1C6, 0x0C7, 0x1C7, 0x0C8, 0x1C8, 0x04F, 0x0CF, 0x14F, 0x1CF, 0x050, 0x0D0, 0x150, 0x1D0,
0x018, 0x058, 0x098, 0x0D8, 0x118, 0x158, 0x198, 0x1D8, 0x11C, 0x120, 0x15C, 0x160, 0x19C, 0x1A0, 0x1DC, 0x1E0,
0x1A2, 0x1A4, 0x1A6, 0x1A8, 0x1E2, 0x1E4, 0x1E6, 0x1E8, 0x030, 0x130, 0x0B0, 0x1B0, 0x070, 0x170, 0x0F0, 0x1F0,
0x038, 0x078, 0x0B8, 0x0F8, 0x138, 0x178, 0x1B8, 0x1F8, 0x17D, 0x1FD, 0x17E, 0x1FE, 0x17F, 0x1FF, 0x180, 0x200,
};

UINT8 *dst = malloc(0x10000);
UINT8 *src = memory_region( REGION_GFX3 );
int size = memory_region_length( REGION_GFX3 );

for ( int i = 0; i < size; i+=0x10000)
{
memcpy(dst, src+i,0x10000);

for ( int j = 0; j < 512; ++j)
{
memcpy(src+i+(kof2002b_sec[j]-1)*128, dst+j*128, 128);
}
}
free(dst);

UINT8 *dst2 = malloc(0x10000);
UINT8 *src2 = memory_region( REGION_GFX1 );
int size2 = memory_region_length( REGION_GFX1 );

for ( int i = 0; i < size2; i+=0x10000)
{
memcpy(dst2, src2+i,0x10000);

for ( int j = 0; j < 512; ++j)
{
memcpy(src2+i+(kof2002b_sec[j]-1)*128, dst2+j*128, 128);
}
}
free(dst2);

}

neo_pcm2_playmore_2002(0); // kof2002
neogeo_fix_bank_type = 0;
init_neogeo();
}
IQ Forum Member

Offline FerchogtX

  • FBA Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
kof2002b driver
« Reply #2 on: January 29, 2005, 06:32:17 PM »
This one is easier and shorter, includes kof2002 drivers
http://ferchogtx.spymac.net/other/kof2002.htm
See ya!!!!!! :D

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
kof2002b driver
« Reply #3 on: January 30, 2005, 01:46:21 AM »
Its not much shorter at all  :p   I already had the PLAYMORE 2002 code since other games use it  . Plus my init is all in one and it works fine .

But why is your neogeo fix bank type  Set at 1 ? when it works fine set at 0
IQ Forum Member

Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Re: kof2002b driver
« Reply #4 on: December 01, 2005, 07:36:40 PM »
Alrighty I gotting the graphics to work now. Is that something now after looking in the kof2002b_kof2002p_kof2004e source in the extrasrc_095.

Now I need to figger out how to fixs the sounds and musics. Yeppy.  :biggrin:

I think it the neo_pcm2_playmore_2002(0); will fixs that.

Code: [Select]
static void kof2002b_gfx_decrypt(unsigned char* src, int size)
{
unsigned short kof2002b_sec[512] = {
0x001, 0x101, 0x002, 0x102, 0x003, 0x103, 0x004, 0x104, 0x009, 0x089, 0x109, 0x189, 0x00A, 0x08A, 0x10A, 0x18A,
0x011, 0x051, 0x091, 0x0D1, 0x111, 0x151, 0x191, 0x1D1, 0x019, 0x01D, 0x059, 0x05D, 0x099, 0x09D, 0x0D9, 0x0DD,
0x021, 0x023, 0x025, 0x027, 0x061, 0x063, 0x065, 0x067, 0x029, 0x129, 0x0A9, 0x1A9, 0x069, 0x169, 0x0E9, 0x1E9,
0x031, 0x071, 0x0B1, 0x0F1, 0x131, 0x171, 0x1B1, 0x1F1, 0x039, 0x0B9, 0x03A, 0x0BA, 0x03B, 0x0BB, 0x03C, 0x0BC,
0x005, 0x105, 0x006, 0x106, 0x007, 0x107, 0x008, 0x108, 0x00B, 0x08B, 0x10B, 0x18B, 0x00C, 0x08C, 0x10C, 0x18C,
0x012, 0x052, 0x092, 0x0D2, 0x112, 0x152, 0x192, 0x1D2, 0x119, 0x11D, 0x159, 0x15D, 0x199, 0x19D, 0x1D9, 0x1DD,
0x0A1, 0x0A3, 0x0A5, 0x0A7, 0x0E1, 0x0E3, 0x0E5, 0x0E7, 0x02D, 0x12D, 0x0AD, 0x1AD, 0x06D, 0x16D, 0x0ED, 0x1ED,
0x035, 0x075, 0x0B5, 0x0F5, 0x135, 0x175, 0x1B5, 0x1F5, 0x03D, 0x0BD, 0x03E, 0x0BE, 0x03F, 0x0BF, 0x040, 0x0C0,
0x041, 0x141, 0x042, 0x142, 0x043, 0x143, 0x044, 0x144, 0x00D, 0x08D, 0x10D, 0x18D, 0x00E, 0x08E, 0x10E, 0x18E,
0x013, 0x053, 0x093, 0x0D3, 0x113, 0x153, 0x193, 0x1D3, 0x01A, 0x01E, 0x05A, 0x05E, 0x09A, 0x09E, 0x0DA, 0x0DE,
0x121, 0x123, 0x125, 0x127, 0x161, 0x163, 0x165, 0x167, 0x02B, 0x12B, 0x0AB, 0x1AB, 0x06B, 0x16B, 0x0EB, 0x1EB,
0x033, 0x073, 0x0B3, 0x0F3, 0x133, 0x173, 0x1B3, 0x1F3, 0x079, 0x0F9, 0x07A, 0x0FA, 0x07B, 0x0FB, 0x07C, 0x0FC,
0x045, 0x145, 0x046, 0x146, 0x047, 0x147, 0x048, 0x148, 0x00F, 0x08F, 0x10F, 0x18F, 0x010, 0x090, 0x110, 0x190,
0x014, 0x054, 0x094, 0x0D4, 0x114, 0x154, 0x194, 0x1D4, 0x11A, 0x11E, 0x15A, 0x15E, 0x19A, 0x19E, 0x1DA, 0x1DE,
0x1A1, 0x1A3, 0x1A5, 0x1A7, 0x1E1, 0x1E3, 0x1E5, 0x1E7, 0x02F, 0x12F, 0x0AF, 0x1AF, 0x06F, 0x16F, 0x0EF, 0x1EF,
0x037, 0x077, 0x0B7, 0x0F7, 0x137, 0x177, 0x1B7, 0x1F7, 0x07D, 0x0FD, 0x07E, 0x0FE, 0x07F, 0x0FF, 0x080, 0x100,
0x081, 0x181, 0x082, 0x182, 0x083, 0x183, 0x084, 0x184, 0x049, 0x0C9, 0x149, 0x1C9, 0x04A, 0x0CA, 0x14A, 0x1CA,
0x015, 0x055, 0x095, 0x0D5, 0x115, 0x155, 0x195, 0x1D5, 0x01B, 0x01F, 0x05B, 0x05F, 0x09B, 0x09F, 0x0DB, 0x0DF,
0x022, 0x024, 0x026, 0x028, 0x062, 0x064, 0x066, 0x068, 0x02A, 0x12A, 0x0AA, 0x1AA, 0x06A, 0x16A, 0x0EA, 0x1EA,
0x032, 0x072, 0x0B2, 0x0F2, 0x132, 0x172, 0x1B2, 0x1F2, 0x139, 0x1B9, 0x13A, 0x1BA, 0x13B, 0x1BB, 0x13C, 0x1BC,
0x085, 0x185, 0x086, 0x186, 0x087, 0x187, 0x088, 0x188, 0x04B, 0x0CB, 0x14B, 0x1CB, 0x04C, 0x0CC, 0x14C, 0x1CC,
0x016, 0x056, 0x096, 0x0D6, 0x116, 0x156, 0x196, 0x1D6, 0x11B, 0x11F, 0x15B, 0x15F, 0x19B, 0x19F, 0x1DB, 0x1DF,
0x0A2, 0x0A4, 0x0A6, 0x0A8, 0x0E2, 0x0E4, 0x0E6, 0x0E8, 0x02E, 0x12E, 0x0AE, 0x1AE, 0x06E, 0x16E, 0x0EE, 0x1EE,
0x036, 0x076, 0x0B6, 0x0F6, 0x136, 0x176, 0x1B6, 0x1F6, 0x13D, 0x1BD, 0x13E, 0x1BE, 0x13F, 0x1BF, 0x140, 0x1C0,
0x0C1, 0x1C1, 0x0C2, 0x1C2, 0x0C3, 0x1C3, 0x0C4, 0x1C4, 0x04D, 0x0CD, 0x14D, 0x1CD, 0x04E, 0x0CE, 0x14E, 0x1CE,
0x017, 0x057, 0x097, 0x0D7, 0x117, 0x157, 0x197, 0x1D7, 0x01C, 0x020, 0x05C, 0x060, 0x09C, 0x0A0, 0x0DC, 0x0E0,
0x122, 0x124, 0x126, 0x128, 0x162, 0x164, 0x166, 0x168, 0x02C, 0x12C, 0x0AC, 0x1AC, 0x06C, 0x16C, 0x0EC, 0x1EC,
0x034, 0x074, 0x0B4, 0x0F4, 0x134, 0x174, 0x1B4, 0x1F4, 0x179, 0x1F9, 0x17A, 0x1FA, 0x17B, 0x1FB, 0x17C, 0x1FC,
0x0C5, 0x1C5, 0x0C6, 0x1C6, 0x0C7, 0x1C7, 0x0C8, 0x1C8, 0x04F, 0x0CF, 0x14F, 0x1CF, 0x050, 0x0D0, 0x150, 0x1D0,
0x018, 0x058, 0x098, 0x0D8, 0x118, 0x158, 0x198, 0x1D8, 0x11C, 0x120, 0x15C, 0x160, 0x19C, 0x1A0, 0x1DC, 0x1E0,
0x1A2, 0x1A4, 0x1A6, 0x1A8, 0x1E2, 0x1E4, 0x1E6, 0x1E8, 0x030, 0x130, 0x0B0, 0x1B0, 0x070, 0x170, 0x0F0, 0x1F0,
0x038, 0x078, 0x0B8, 0x0F8, 0x138, 0x178, 0x1B8, 0x1F8, 0x17D, 0x1FD, 0x17E, 0x1FE, 0x17F, 0x1FF, 0x180, 0x200,
};
int i, j;
UINT8 *dst = malloc(0x10000);
for (i = 0; i < size; i+=0x10000) {
memcpy(dst, src+i,0x10000);
for (j = 0; j < 512; ++j) {
memcpy(src+i+(kof2002b_sec[j]-1)*128, dst+j*128, 128);
}
}
free(dst);
}

// © PLAYMORE 2002 20-09-2004
//-------- to decypt v roms -----------------
static void neo_pcm2_playmore_2002(int value)
{
          //kof2002,matrimelee,mslug5 (pcb and mvs),samsho5,svcchaos (pcb and mvs),kof2003 (pcb and mvs),samsh5sp (mvs and aes)
          //offset,xor address
          unsigned int addrs[7][2]={
          {0x000000,0xA5000}, //kof2002
          {0xFFCE20,0x01000}, //matrimelee
          {0xFE2CF6,0x4E001}, //mslug5
          {0xFEB2C0,0x0A000}, //samsho5
          {0xFFAC28,0xC2000}, //svcchaos
          {0xFF14EA,0xA7001}, //kof2003
          {0xFFB440,0x02000}, //samsh5sp
          };
          unsigned int xordata[7][8]={
          {0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
          {0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
          {0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
          {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( kof2002b )
{
kof2002b_gfx_decrypt(memory_region(REGION_GFX3),0x4000000);
kof2002b_gfx_decrypt(memory_region(REGION_GFX1),0x20000);
        neo_pcm2_playmore_2002(0);
neogeo_fix_bank_type = 1;
init_neogeo();
}

Edit: This totally f###.
Why there is an error on the  neo_pcm2_playmore_2002(0); ???
« Last Edit: December 02, 2005, 10:59:40 AM by KingHanco »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3619
  • Karma: +385/-0
  • Bare Knuckle!
    • NeoSource
Re: kof2002b driver
« Reply #5 on: December 02, 2005, 12:40:37 PM »


Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Re: kof2002b driver
« Reply #6 on: December 02, 2005, 08:20:02 PM »
God I'm good.

http://neo-source.com/index.php?topic=375.msg3385#msg3385

I try that and I get this error.

redefinition of 'neo_pcm2_playmore_2002'
previous definition of 'neo_pcm2_playmore_2002' was here

Code: [Select]
void kof2002b_gfx_decrypt(UINT8 *src, int size)
{
        int i, j;
        int t[8][10] =
        {
        { 0, 8, 7, 3, 4, 5, 6, 2, 1 },
        { 1, 0, 8, 4, 5, 3, 7, 6, 2 },
        { 2, 1, 0, 3, 4, 5, 8, 7, 6 },
        { 6, 2, 1, 5, 3, 4, 0, 8, 7 },
        { 7, 6, 2, 5, 3, 4, 1, 0, 8 },
        { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
        { 2, 1, 0, 4, 5, 3, 6, 7, 8 },
        { 8, 0, 7, 3, 4, 5, 6, 2, 1 },
        };

        UINT8 *dst = malloc(0x10000);

        for (i = 0; i < size; i+=0x10000)
        {
        memcpy(dst, src+i,0x10000);

        for (j = 0; j < 0x200; j++)
        {
        int n = ((j % 0x40) / 8);
        int ofst = BITSWAP16(j, 15, 14, 13, 12, 11, 10, 9, t[n][0], t[n][1], t[n][2],
        t[n][3], t[n][4], t[n][5], t[n][6], t[n][7], t[n][8]);
        memcpy(src+i+ofst*128, dst+j*128, 128);
        }
        }
    free(dst);
}

// © PLAYMORE 2002 20-09-2004
//-------- to decypt v roms -----------------
static void neo_pcm2_playmore_2002(int value)
{
          //kof2002,matrimelee,mslug5 (pcb and mvs),samsho5,svcchaos (pcb and mvs),kof2003 (pcb and mvs),samsh5sp (mvs and aes)
          //offset,xor address
          unsigned int addrs[7][2]={
          {0x000000,0xA5000}, //kof2002
          {0xFFCE20,0x01000}, //matrimelee
          {0xFE2CF6,0x4E001}, //mslug5
          {0xFEB2C0,0x0A000}, //samsho5
          {0xFFAC28,0xC2000}, //svcchaos
          {0xFF14EA,0xA7001}, //kof2003
          {0xFFB440,0x02000}, //samsh5sp
          };
          unsigned int xordata[7][8]={
          {0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
          {0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
          {0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
          {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( kof2002b )
{
        int sec[] = { 0x02, 0x05, 0x06, 0x03, 0x00, 0x07, 0x04, 0x01 };

        int i, rom_size = 0x400000;
        UINT8 *src = memory_region(REGION_CPU1)+0x100000;
        UINT8 *dst = malloc( rom_size );

        memcpy( dst, src, rom_size);
        for( i=0; i<8; i++){
        memcpy( src+i*0x80000, dst+sec[i]*0x80000, 0x80000);
        }
        free( dst );

        kof2002b_gfx_decrypt(memory_region(REGION_GFX3), 0x4000000);
        kof2002b_gfx_decrypt(memory_region(REGION_GFX1), 0x0020000);

        neo_pcm2_playmore_2002(0);
        neogeo_fix_bank_type = 0;
    init_neogeo();
}

This one already been use and can't be use again right? The kof2003 is using it.

Code: [Select]
static void kof2003_px_decrypt( void )
{
        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);
}

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 );
    }
}

// © PLAYMORE 2002 20-09-2004
//-------- to decypt v roms -----------------
static void neo_pcm2_playmore_2002(int value)
{
          //kof2002,matrimelee,mslug5 (pcb and mvs),samsho5,svcchaos (pcb and mvs),kof2003 (pcb and mvs),samsh5sp (mvs and aes)
          //offset,xor address
          unsigned int addrs[7][2]={
          {0x000000,0xA5000}, //kof2002
          {0xFFCE20,0x01000}, //matrimelee
          {0xFE2CF6,0x4E001}, //mslug5
          {0xFEB2C0,0x0A000}, //samsho5
          {0xFFAC28,0xC2000}, //svcchaos
          {0xFF14EA,0xA7001}, //kof2003
          {0xFFB440,0x02000}, //samsh5sp
          };
          unsigned int xordata[7][8]={
          {0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
          {0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
          {0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
          {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( kof2003 )
{
        kof2003_px_decrypt();
        kof2003_sx_decrypt();
        neo_pcm2_playmore_2002(5);
        neogeo_fix_bank_type = 2;
    init_neogeo();
}

This what I'm talking about bellow.

Code: [Select]
// © PLAYMORE 2002 20-09-2004
//-------- to decypt v roms -----------------
static void neo_pcm2_playmore_2002(int value)
{
          //kof2002,matrimelee,mslug5 (pcb and mvs),samsho5,svcchaos (pcb and mvs),kof2003 (pcb and mvs),samsh5sp (mvs and aes)
          //offset,xor address
          unsigned int addrs[7][2]={
          {0x000000,0xA5000}, //kof2002
          {0xFFCE20,0x01000}, //matrimelee
          {0xFE2CF6,0x4E001}, //mslug5
          {0xFEB2C0,0x0A000}, //samsho5
          {0xFFAC28,0xC2000}, //svcchaos
          {0xFF14EA,0xA7001}, //kof2003
          {0xFFB440,0x02000}, //samsh5sp
          };
          unsigned int xordata[7][8]={
          {0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
          {0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
          {0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
          {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);
}
« Last Edit: December 02, 2005, 08:27:45 PM by KingHanco »

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Re: kof2002b driver
« Reply #7 on: December 02, 2005, 09:03:15 PM »
You do not put that code for every driver it only needed to be added once just add the code just above all other driver_init and things should be fine   :idiot:


only add this code once and once only it does not get added to every driver ADD IT JUST ABOVE ALL OTHER DRIVER_INIT
Code: [Select]
// © PLAYMORE 2002 20-09-2004
static void neo_pcm2_playmore_2002(int value)
{
          //kof2002,matrimelee,mslug5 (pcb and mvs),samsho5,svcchaos (pcb and mvs),kof2003 (pcb and mvs),samsh5sp (mvs and aes)
          //offset,xor address
          unsigned int addrs[7][2]={
          {0x000000,0xA5000}, //kof2002
          {0xFFCE20,0x01000}, //matrimelee
          {0xFE2CF6,0x4E001}, //mslug5
          {0xFEB2C0,0x0A000}, //samsho5
          {0xFFAC28,0xC2000}, //svcchaos
          {0xFF14EA,0xA7001}, //kof2003
          {0xFFB440,0x02000}, //samsh5sp
          };
          unsigned int xordata[7][8]={
          {0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
          {0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
          {0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
          {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
          {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);
« Last Edit: December 02, 2005, 09:12:32 PM by James33 »
IQ Forum Member

Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Re: kof2002b driver
« Reply #8 on: December 02, 2005, 09:09:35 PM »
You do not put that code for every driver it only need to added once just add the code just above all other driver_init and things should be fine   :idiot:


only add this code once and once only it does not get added to every driver ADD IT JUST ABOVE ALL OTHER DRIVER_INIT

Oh ok then. For now on I use 1 only and don't add another one with another DRIVER_INIT.
« Last Edit: December 03, 2005, 02:53:42 AM by KingHanco »

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Re: kof2002b driver
« Reply #9 on: December 02, 2005, 09:13:11 PM »
Ok good :)
IQ Forum Member