Author Topic: Power Instinct Matrimelee [Driver]  (Read 7949 times)

Offline X-or

  • Newbies
  • *
  • Posts: 38
  • Karma: +0/-0
Power Instinct Matrimelee [Driver]
« on: December 02, 2004, 08:03:47 PM »
final driver for the original encrypted set (100% verified)
2nd p-rom is slightly scrambled
sound roms use neo-pcm2
you can rename pwrinst4 to matrim if you feel like it
I recommand you to remove the bootleg from your build as it's adding nothing


Code: [Select]
ROM_START( pwrinst4 ) /* Original Version - Encrypted */
/* Encrypted p2 */
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) )

/* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
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) )

/* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
ROM_REGION( 0x20000, REGION_USER4, 0 )
ROM_LOAD_OPTIONAL( "266-m1.bin", 0x00000, 0x20000, CRC(456c3e6c) SHA1(5a07d0186198a18d2dda1331093cf29b0b9b2984) )
NEO_BIOS_SOUND_128K( "266-m1d.bin", CRC(f692d84b) SHA1(a3737c574e779e0330916a2eea6ad5b3839f9538) )

/* Encrypted */
ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "266-v1.bin", 0x000000, 0x800000, CRC(a4f83690) SHA1(200d683d8c30ebc6d0ed331aa5bbba39b4e07160) )
ROM_LOAD( "266-v2.bin", 0x800000, 0x800000, CRC(d0f69eda) SHA1(9d7e98976ad433ed8a35d7afffa38130444ba7db) )

NO_DELTAT_REGION

/* Encrypted */
ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "266-c1.bin", 0x0000000, 0x800000, CRC(505f4e30) SHA1(f22b6f76fc0cad963555dc89d072967c8dc8b79a) )
ROM_LOAD16_BYTE( "266-c2.bin", 0x0000001, 0x800000, CRC(3cb57482) SHA1(dab15bc24391f9a5173de76af48b612fb9636ccf) )
ROM_LOAD16_BYTE( "266-c3.bin", 0x1000000, 0x800000, CRC(f1cc6ad0) SHA1(66c1cccc0332ffd2d3064f06330c41f95ca09ced) )
ROM_LOAD16_BYTE( "266-c4.bin", 0x1000001, 0x800000, CRC(45b806b7) SHA1(c2bb866fded53d62fad0fc88d89d5e7d4cb1894f) )
ROM_LOAD16_BYTE( "266-c5.bin", 0x2000000, 0x800000, CRC(9a15dd6b) SHA1(194a6973a7a9e3847efe1bdbaeaeb16e74aff2dd) )
ROM_LOAD16_BYTE( "266-c6.bin", 0x2000001, 0x800000, CRC(281cb939) SHA1(bdb7766cfde581ccfaee2be7fe48445f360a2301) )
ROM_LOAD16_BYTE( "266-c7.bin", 0x3000000, 0x800000, CRC(4b71f780) SHA1(d5611a6f6b730db58613b48f2b0174661ccfb7bb) )
ROM_LOAD16_BYTE( "266-c8.bin", 0x3000001, 0x800000, CRC(29873d33) SHA1(dc77f129ed49b8d40d0d4241feef3f6c2f19a987) )
ROM_END

static void matrim_vx_decrypt( void )
{
const unsigned char xor[ 0x08 ] = {
0xc4, 0x83, 0xa8, 0x5f, 0x21, 0x27, 0x64, 0xaf
};

int vx_size = memory_region_length( REGION_SOUND1 );
UINT8 *rom = memory_region( REGION_SOUND1 );
UINT8 *buf = malloc( vx_size );
int ofst;

memcpy( buf, rom, vx_size );

for( int i = 0; i < vx_size; i++ ){
ofst = (i & 0xfefffe) |
  ((i & 0x010000) >> 16) |
  ((i & 0x000001) << 16);

ofst ^= 0x01000;

rom[ ofst ] = buf[ ((i + 0xffce20) & 0xffffff) ] ^ xor[ (ofst & 0x07) ];
}

free( buf );
}

DRIVER_INIT( pwrinst4 )
{
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);
}
matrim_vx_decrypt();
neogeo_fix_bank_type = 2;
kof2000_neogeo_gfx_decrypt(0x6a);
init_neogeo();
}

/* Noise Factory */
GAMEB( 2003, pwrinst4, neogeo,   neogeo, neogeo, neogeo,  pwrinst4, ROT0, "Noise Factory / Atlus Corporation", "Matrimelee - Shin Goketsuji Ichizoku" )
« Last Edit: May 10, 2005, 01:20:56 PM by iq_132 »

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Correct name Matrimelee
« Reply #1 on: December 05, 2004, 03:39:54 AM »
Known as Matrimelee  I have the cart so I am sure .

I use this

This part of the code only needs to be used once because the code is for more than one game

Code: [Select]

/* Code by fataku */
// © 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
                 {0x000000,0x00000}, //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
                 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //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,1  1,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);
}


Code: [Select]

ROM_START( matrim )
        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) )
       
        /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
        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) )
       
ROM_REGION( 0x20000, REGION_USER4, 0 )
ROM_LOAD( "266-m1.bin", 0x00000, 0x20000, CRC(456c3e6c) SHA1(5a07d0186198a18d2dda1331093cf29b0b9b2984) ) /* encrypted, we load it here for reference and replace with decrypted ROM */
NEO_BIOS_SOUND_128K( "266-m1d.bin", CRC(f692d84b) SHA1(a3737c574e779e0330916a2eea6ad5b3839f9538) )

        ROM_REGION( 0X1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
        /* encrypted, we load these here for reference and replace with decrypted ROMs */
ROM_LOAD( "266-v1.bin", 0x000000, 0x800000, CRC(a4f83690) SHA1(200d683d8c30ebc6d0ed331aa5bbba39b4e07160) )
ROM_LOAD( "266-v2.bin", 0x800000, 0x800000, CRC(d0f69eda) SHA1(9d7e98976ad433ed8a35d7afffa38130444ba7db) )
/* decrypted */
// ROM_LOAD( "266-v1d.bin", 0x000000, 0x800000, CRC(328b2194) SHA1(6734da4f1e882a8524c04ff375567ed96a2dae5e) )
// ROM_LOAD( "266-v2d.bin", 0x800000, 0x800000, CRC(2a13562d) SHA1(dc13f1af6afaf43f2ac20b7cf1c751a047450312) )
       
        NO_DELTAT_REGION

        ROM_REGION( 0x4000000, REGION_GFX3, 0 )
        ROM_LOAD16_BYTE( "266-c1.bin", 0x0000000, 0x800000, CRC(505f4e30) SHA1(f22b6f76fc0cad963555dc89d072967c8dc8b79a) ) /* Plane 0,1 */
        ROM_LOAD16_BYTE( "266-c2.bin", 0x0000001, 0x800000, CRC(3cb57482) SHA1(dab15bc24391f9a5173de76af48b612fb9636ccf) ) /* Plane 2,3 */
        ROM_LOAD16_BYTE( "266-c3.bin", 0x1000000, 0x800000, CRC(f1cc6ad0) SHA1(66c1cccc0332ffd2d3064f06330c41f95ca09ced) ) /* Plane 0,1 */
        ROM_LOAD16_BYTE( "266-c4.bin", 0x1000001, 0x800000, CRC(45b806b7) SHA1(c2bb866fded53d62fad0fc88d89d5e7d4cb1894f) ) /* Plane 2,3 */
        ROM_LOAD16_BYTE( "266-c5.bin", 0x2000000, 0x800000, CRC(9a15dd6b) SHA1(194a6973a7a9e3847efe1bdbaeaeb16e74aff2dd) ) /* Plane 0,1 */
        ROM_LOAD16_BYTE( "266-c6.bin", 0x2000001, 0x800000, CRC(281cb939) SHA1(bdb7766cfde581ccfaee2be7fe48445f360a2301) ) /* Plane 2,3 */
        ROM_LOAD16_BYTE( "266-c7.bin", 0x3000000, 0x800000, CRC(4b71f780) SHA1(d5611a6f6b730db58613b48f2b0174661ccfb7bb) ) /* Plane 0,1 */
        ROM_LOAD16_BYTE( "266-c8.bin", 0x3000001, 0x800000, CRC(29873d33) SHA1(dc77f129ed49b8d40d0d4241feef3f6c2f19a987) ) /* Plane 2,3 */
ROM_END



/* Code by fataku */
// © 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
                 {0x000000,0x00000}, //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
                 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //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( 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();
}



GAMEB( 2002, matrim,   neogeo,  neogeo, neogeo, neogeo, matrim,   ROT0, "Playmore Corporation / Atlus", "Matrimelee" )
IQ Forum Member

Offline X-or

  • Newbies
  • *
  • Posts: 38
  • Karma: +0/-0
Power Instinct Matrimelee [Driver]
« Reply #2 on: December 05, 2004, 07:26:46 AM »
:eek: this is looking damn good James

where have you found that code?

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Power Instinct Matrimelee [Driver]
« Reply #3 on: December 05, 2004, 08:05:01 AM »
« Last Edit: May 10, 2005, 01:22:00 PM by iq_132 »
IQ Forum Member

Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Ok.
« Reply #4 on: December 11, 2004, 06:13:28 PM »
I want to try to coding this in.

Where and what files do I added this in at?

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
IQ Forum Member

Offline robber804

  • Newbies
  • *
  • Posts: 40
  • Karma: +0/-0
  • Relentless Bastard
matrima
« Reply #6 on: December 30, 2004, 03:03:09 PM »
P roms don't use the same code as the original matrim, haven't had time to look at them.   The board won't let me attach any files for the patches for the p roms either :S

Code: [Select]

ROM_START( matrima ) /* Alternate Version - Encrypted */
ROM_REGION( 0x500000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "266-p1a.bin", 0x000000, 0x100000, CRC(472632f7) SHA1(c3e9abb3bea9c7b89f05c1ea44cbfda42223a6c0) )
ROM_LOAD16_WORD_SWAP( "266-p2a.bin", 0x100000, 0x400000, CRC(d9a86394) SHA1(f70f9e2553b8c326452338f6601b2e67531c3e10) )

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

ROM_REGION( 0x20000, REGION_USER4, 0 )
ROM_LOAD_OPTIONAL( "266-m1a.bin", 0x00000, 0x20000, CRC(8f9f26e1) ) /* still missing */
NEO_BIOS_SOUND_128K( "266-m1d.bin", CRC(7bcafd98) SHA1(9ecd52ed9f428d529fc66313a2debaeec649b1c3) )

ROM_REGION( 0X1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "266-v1a.bin", 0x000000, 0x800000, CRC(7acaa8e7) SHA1(4d088ce02bb6964ccc98e84ded02a10f09d7f621) )
ROM_LOAD( "266-v2a.bin", 0x800000, 0x800000, CRC(02ca2a00) SHA1(196e01c69d55e23be0afb1a1a361a279a57bbca3) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "266-c1.bin", 0x0000000, 0x800000, CRC(505f4e30) SHA1(f22b6f76fc0cad963555dc89d072967c8dc8b79a) )
ROM_LOAD16_BYTE( "266-c2.bin", 0x0000001, 0x800000, CRC(3cb57482) SHA1(dab15bc24391f9a5173de76af48b612fb9636ccf) )
ROM_LOAD16_BYTE( "266-c3.bin", 0x1000000, 0x800000, CRC(f1cc6ad0) SHA1(66c1cccc0332ffd2d3064f06330c41f95ca09ced) )
ROM_LOAD16_BYTE( "266-c4.bin", 0x1000001, 0x800000, CRC(45b806b7) SHA1(c2bb866fded53d62fad0fc88d89d5e7d4cb1894f) )
ROM_LOAD16_BYTE( "266-c5.bin", 0x2000000, 0x800000, CRC(9A15DD6B) SHA1(194a6973a7a9e3847efe1bdbaeaeb16e74aff2dd) )
ROM_LOAD16_BYTE( "266-c6.bin", 0x2000001, 0x800000, CRC(281cb939) SHA1(bdb7766cfde581ccfaee2be7fe48445f360a2301) )
ROM_LOAD16_BYTE( "266-c7.bin", 0x3000000, 0x800000, CRC(4b71f780) SHA1(d5611a6f6b730db58613b48f2b0174661ccfb7bb) )
ROM_LOAD16_BYTE( "266-c8.bin", 0x3000001, 0x800000, CRC(29873d33) SHA1(dc77f129ed49b8d40d0d4241feef3f6c2f19a987) )
ROM_END
-robber804

Offline fataku

  • Newbies
  • *
  • Posts: 22
  • Karma: +0/-0
  • Junior Member
Power Instinct Matrimelee [Driver]
« Reply #7 on: December 30, 2004, 06:06:10 PM »
forget about matrima, thats not a real board, even its not a bootleg one, its a hack founded in a mexican mame machine, protected by the guy who sell those mame machine..., its useless  :rolleyes:

Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
Power Instinct Matrimelee [Driver]
« Reply #8 on: December 30, 2004, 06:53:56 PM »
Quote from: fataku
forget about matrima, thats not a real board, even its not a bootleg one, its a hack founded in a mexican mame machine, protected by the guy who sell those mame machine..., its useless  :rolleyes:

Cool, so its just a hack by a mexican mame machine seller?! lol   :D
So now theres only kof2003a (just missing the 68k roms) and cthd2k3a remaning ? Or there are more alternate sets to come?
Thanks in advance :cool:

Offline robber804

  • Newbies
  • *
  • Posts: 40
  • Karma: +0/-0
  • Relentless Bastard
Power Instinct Matrimelee [Driver]
« Reply #9 on: December 30, 2004, 07:35:08 PM »
Quote from: fataku
forget about matrima, thats not a real board, even its not a bootleg one, its a hack founded in a mexican mame machine, protected by the guy who sell those mame machine..., its useless  :rolleyes:


Even so seeing how he protected it would be interesting, at least to me.  You never know when you might encounter a similar protection again.
-robber804

Offline robber804

  • Newbies
  • *
  • Posts: 40
  • Karma: +0/-0
  • Relentless Bastard
Power Instinct Matrimelee [Driver]
« Reply #10 on: December 30, 2004, 07:36:46 PM »
Quote from: Jimmy_Page
Cool, so its just a hack by a mexican mame machine seller?! lol   :D
So now theres only kof2003a (just missing the 68k roms) and cthd2k3a remaning ? Or there are more alternate sets to come?
Thanks in advance :cool:


Or were all the "a" sets from the Mexican MAME Machine Maker  (aka MMAMEMM).
-robber804