libretro / mame2003-plus-libretro

Updated 2018 version of MAME (0.78) for libretro. with added game support plus many fixes and improvements
Other
188 stars 108 forks source link

cps2 encryption #1424

Closed MistyDreams closed 2 years ago

MistyDreams commented 2 years ago

been looking at some cps2 games that don't work. I see we are using the old xor decryption. Before I go on useless journey wondering if any here has attempted the key decryption for the games that aren't done.

MistyDreams commented 2 years ago

well that was painless encryption is sorted will close this any cps2 games can be added now if you want to add more or just fix the broken ones. I wanted the 19xx sets done dont want to add too much though. If there is any in particular you want fixed or added let me know. Or you can just add as you wish will close this for now.

arcadez2003 commented 2 years ago

Good thinking it never occurred to me to add support for the new style cps decryption, it's defo worth updating the romsets for Hyper Street Fighter II as at the moment we only support a hacked version which requires users to grab unofficial XOR's that are not widely available.

I'll look into adding the proper sets for this game sometime, unless someone still fresh from working on this and in the know better than me feels like doin it :)

MistyDreams commented 2 years ago

all you need to do is add the rom rom latest mame.

add the user1 region with no roms.

update any other roms gfx,cpu and audio

add the key user5 region with no roms.

use my_cps2 init in the game definition. Im not sure on the rules of romsets so I didnt want to overstep. obviously there might still be some cps2 bugs but it opens up options.

I will need to add a check for the key not being present if needed at some point if you want to use dead board decryption

MistyDreams commented 2 years ago
ROM_START( hsf2 )
    ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
    ROM_LOAD16_WORD_SWAP( "hs2u.03",  0x000000, 0x80000, CRC(b308151e) SHA1(afdfd3b049c6435e2291bc35d8c26ff5bff223d8) )
    ROM_LOAD16_WORD_SWAP( "hs2u.04",  0x080000, 0x80000, CRC(327aa49c) SHA1(6719cd6ecc2a4487fdbf5cbcd47e35fc43000607) )
    ROM_LOAD16_WORD_SWAP( "hs2.05",   0x100000, 0x80000, CRC(dde34a35) SHA1(f5be2d2916db6e86e0886d61d55bddf138273ebc) )
    ROM_LOAD16_WORD_SWAP( "hs2.06",   0x180000, 0x80000, CRC(f4e56dda) SHA1(c6490707c2a416ab88612c2d73abbe5853d8cb92) )
    ROM_LOAD16_WORD_SWAP( "hs2.07",   0x200000, 0x80000, CRC(ee4420fc) SHA1(06cf76660b0c794d2460c52d9fe8334fff51e9de) )
    ROM_LOAD16_WORD_SWAP( "hs2.08",   0x280000, 0x80000, CRC(c9441533) SHA1(bf178fac1f060fcce3ff9118333c8517dadc9429) )
    ROM_LOAD16_WORD_SWAP( "hs2.09",   0x300000, 0x80000, CRC(3fc638a8) SHA1(2a42877b26c8abc437da46225701f0bba6e40058) )
    ROM_LOAD16_WORD_SWAP( "hs2.10",   0x380000, 0x80000, CRC(20d0f9e4) SHA1(80a5eeef9472e327b0d4ee26434bad109a9434ea) )

    ROM_REGION16_BE( CODE_SIZE,REGION_USER1 , 0 )

    ROM_REGION( 0x2000000, REGION_GFX1, 0 )
    ROM_LOAD64_WORD( "hs2.13m",   0x0000000, 0x800000, CRC(a6ecab17) SHA1(6749a4c8dc81f4b10f910c31c82cf6674e2a44eb) )
    ROM_LOAD64_WORD( "hs2.15m",   0x0000002, 0x800000, CRC(10a0ae4d) SHA1(701b4900fbc8bef20efa1a706891c8df4bf14641) )
    ROM_LOAD64_WORD( "hs2.17m",   0x0000004, 0x800000, CRC(adfa7726) SHA1(8d36ec125a8c91abfe5213893d794f8bc11c8acd) )
    ROM_LOAD64_WORD( "hs2.19m",   0x0000006, 0x800000, CRC(bb3ae322) SHA1(ecd289d7a0fe365fdd7c5527cb17796002beb553) )

    ROM_REGION( QSOUND_SIZE, REGION_CPU2, 0 ) /* 64k for the audio CPU (+banks) */
    ROM_LOAD( "hs2.01",   0x00000, 0x08000, CRC(c1a13786) SHA1(c7392c7efb15ea4042e75bd9007e974293d8935d) )
    ROM_CONTINUE(         0x10000, 0x18000 )
    ROM_LOAD( "hs2.02",   0x28000, 0x20000, CRC(2d8794aa) SHA1(c634affdc2568020cce6af97b4fa79925d9943f3) )

    ROM_REGION( 0x800000, REGION_SOUND1, 0 ) /* QSound samples */
    ROM_LOAD16_WORD_SWAP( "hs2.11m",   0x000000, 0x800000, CRC(0e15c359) SHA1(176108b0d76d821a849324680aba0cd04b5016c1) )

    ROM_REGION( 0x20, REGION_USER5, 0 )
    ROM_LOAD( "hsf2.key",     0x000000, 0x000014, CRC(fc9b18c9) SHA1(457b6ba05458f1be9ebb8aa9cbab0a8808cb6857) )
ROM_END
GAME( 2004, hsf2,     0,       cps2, ssf2, my_cps2, ROT0,   "Capcom", "Hyper Street Fighter II: The Anniversary Edition (USA 040202)" )

you also need to add (I think this code will need to be updated to get the regs at some point"

    {"hsf2",   NOBATTRY, 4,4,0, 0x0000,0xffff,0x0000,0xffff, 9 }, to the video code else the gfx will be corrupted

https://github.com/libretro/mame2003-plus-libretro/blob/f53fe6f227ddb6dd27464d5a74ca40e12a228c6d/src/vidhrdw/cps1_vidhrdw.c#L388-L411

MistyDreams commented 2 years ago

I can add this if you like would rather show you though so you can add whatever you feel like adding

arcadez2003 commented 2 years ago

Aye nae worries i'll get round to it soon im a bit hot and bothered today, was really just wanting to know how to handle the romsets as per this core and i have the answer now :)

arcadez2003 commented 2 years ago

There are some more improvements i shoudld really look into backporting here a fix for Varth for example and some of the games need reclocked as per pcb type something for a rainy day i guess......

0.124u4: Fixed layer enable at the end of stage 4 in Varth. Increased Varth CPU clock to 12MHz to reduce slowdowns (the game was released after 'Street Fighter II' - Champion Edition (World 920313)' so the faster A-board was available) [Nicola Salmoria, Corrado Tomaselli, Charles MacDonald].

MistyDreams commented 2 years ago

I wasnt looking to make rabbit holes for you have a few days off work as of yesterday. This looked like a nice potential fix for available games. I dont want to mess with the romsets after the system16 issues so ill leave on advice or for you guys to do.

Dont mind adding the games if requested just dont want waste time if it messes up what you guys want to do. I can help with the 084 port if that is something that will interest you. I cant cant compile MAMEoXtras right enough but should be simple enough to port cause i fixed the windows mame084 to compile. I think Ill do the same for mame078 a debugger would really come in handy at times.

arcadez2003 commented 2 years ago

Yeah i thought it worth doin Hyper Street Fighter II for the reasons i mentioned earlier there are good few more that like the 19XX games can be fixed up via this method so all the sets work i suppose it all comes to down time and the inclination to spend the hours required doin it.

There are pro's and cons with regards to updating every romset right enough.

arcadez2003 commented 2 years ago

Do we need to keep the sf2 input cfgs i noticed you left em out as per the commit........

GAMEC(2004, hsf2a, 0, cps2, ssf2, cps2, ROT0, "Capcom", "Hyper Street Fighter II: The Anniversary Edition (Asia 040202)", &sf2_ctrl, NULL )

MistyDreams commented 2 years ago

No others had it in the driver so not sure if its wanted or needed the controls work if thats what your asking. Sorry on a phone here can add it if you like you want it on hsf2a or all of them

MistyDreams commented 2 years ago

Ok pull request is in just copied and pasted from mame and changed to our format. 19xx didn't have this I checked the original encryption pull request .

all the roms are converted here. and most if the inits been tied up so you can add what you want easier. Like i said this is easy enough to do but not sure what sets you guys want and don't and testing needs done along the way, This will make copying and pasting a lot easier

cps.zip

arcadez2003 commented 2 years ago

Yeah i think it's something to do with button mappings for the fighting games so when i originally added hsf2 i hooked it up to use the standard Street Fighter II defaults anyway it's sorted now.

As for other games there are a couple where we only have a Japan version playable and since they have multigame styles and menus where you choose what type of game you wanna play which are all in japanese it would be better to support the world versions also which are all in English these are Mighty Pang and Puzz Loop 2.

It wasn't possible to do that for this core previously but now you've updated and added a secondary decryption routine it's now on the cards along with many others it's as i said though finding the time and will to work on getting games to work when we already have a working version anyhow.

But i wont be able to work on mpang and puzlzoop2 just now as the heat is getting to me.

MistyDreams commented 2 years ago

all sets of pzloop and mpang are added and tested to work with controls. It was just a copy and paste the pull req is in. Didnt test or add choko as we dont have that set anyway

arcadez2003 commented 2 years ago

Nice to see this thanks for goin to the trouble of adding all the sets it makes a big difference to know what type of game your starting rather than guesswork unless you understand japanese, as for choko it's not worth bothering with IMO