Author Topic: CPS-III driver preview  (Read 112328 times)

Offline KOF2112

  • Expert
  • *****
  • Posts: 187
  • Karma: +14/-4
Re: CPS-III driver preview
« Reply #15 on: December 28, 2007, 01:29:56 PM »
i found this question too , change some code :
Code: [Select]

static int Cps3Reset()
{
// re-map cram_bank
cram_bank = 0;
Sh2MapMemory((unsigned char *)RamCRam, 0x04100000, 0x041fffff, SM_RAM);

#if 0
Sh2Reset( *(unsigned int *)(RomBios + 0), *(unsigned int *)(RomBios + 4) );
#else
// fast boot
Sh2Reset( *(unsigned int *)(RomGame_D + 0), *(unsigned int *)(RomGame_D + 4) );
Sh2SetVBR( 0x06000000);
#endif
 .....
and change a chd bios file to redearth_nocd.bios . we can got it run to it's intro ...



change some code After sfiii2 cannot play

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #16 on: December 28, 2007, 01:52:28 PM »
Check this out lol  :p

I commented the redeartn bios rom and it passed the title screen but seems that GFXs didn't load (btw, region appeared as Oceania  :confused:)





@OopsWare: Check the first page of this topic because there are some recent posts for you ^^ that may help you with your progress  :wink:.

SeeYaa!
 :biggrin:
« Last Edit: February 01, 2010, 08:59:52 AM by CaptainCPS-X »

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #17 on: December 28, 2007, 04:17:43 PM »
Check this out people !!! ThanX to IQ_132 for helping me with my cps3run.cpp & d_cps3.cpp modifications, we were able to do this on FBA








The modifications only affect 'redeartn' so other CPS-3 games are working fine.

I will post the code very soon, we're trying to find out how to get the correct region 'Asia' to show up

SeeYaa!
 :biggrin:

« Last Edit: February 01, 2010, 09:00:18 AM by CaptainCPS-X »

Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: CPS-III driver preview
« Reply #18 on: December 28, 2007, 04:55:55 PM »
Amazing the work done in so little time :eek:...Very impressive :smilie:
Great job Guys...Waiting for your next release impatiently CaptainCPS-X


Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #19 on: December 28, 2007, 07:48:00 PM »
More previews guys!! More stuff working than expected ^^

:biggrin:










I will try other games to see if I can change region like with Red Earth ^^ anyway I will release the code along with the FBA Enhanced R10 in a few minutes  :smilie:

SeeYaa!
 :biggrin:
« Last Edit: February 01, 2010, 09:00:50 AM by CaptainCPS-X »

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #20 on: December 28, 2007, 09:03:57 PM »
Well here you have the modified 'cps3run.cpp' & 'd_cps3.cpp' with Red Earth (NO CD) Working in all regions  :biggrin: (I added all region clone drivers)

The romsets are not new zips or something like that, they use the same roms that 'redeartn' use AND there is a region patching done with different values depending on what romset we're loading. Here you have the code so you can see more clear what Im saying:

Quote

   // 0x06000000 - JAPAN (WARZARD)
   // 0x05000000 - ASIA
   // 0x04000000 - EURO
   // 0x03000000 - USA
   // 0x02000000 - HISPANIC
   // 0x01000000 - BRAZIL
   // 0x00000000 - OCEANIA

   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redeartn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x05000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearen")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x04000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearun")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x03000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearhn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x02000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearbn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x01000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearon")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x00000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearjn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x06000000; }

   be_to_le( RomBios, 0x080000 );
   cps3_decrypt_bios();

   ...




and the problem that KOF2112 was mentioning was fixed with an IF statement, here you can see how + the new code...

Quote

static int Cps3Reset()
{
   // re-map cram_bank
   cram_bank = 0;
   Sh2MapMemory((unsigned char *)RamCRam, 0x04100000, 0x041fffff, SM_RAM);

   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redeartn") || // Asia
      !strcmp(BurnDrvGetTextA(DRV_NAME), "redearen") || // Euro
      !strcmp(BurnDrvGetTextA(DRV_NAME), "redearun") || // USA
      !strcmp(BurnDrvGetTextA(DRV_NAME), "redearhn") || // Hispanic
      !strcmp(BurnDrvGetTextA(DRV_NAME), "redearbn") || // Brazil
      !strcmp(BurnDrvGetTextA(DRV_NAME), "redearon") || // Oceania
      !strcmp(BurnDrvGetTextA(DRV_NAME), "redearjn") )  // Japan (War-Zard)
   {
      // fast boot    
      Sh2Reset( *(unsigned int *)(RomGame_D   + 0), *(unsigned int *)(RomGame_D + 4) );
      Sh2SetVBR(0x06000000);
   } else   {
      Sh2Reset( *(unsigned int *)(RomBios      + 0), *(unsigned int *)(RomBios + 4) );
   }
   
   cps3_flash_init( &main_flash );
   
   cps3_current_eeprom_read = 0;
   
   cps3SndReset();
   
   cps3_reset = 0;
   
   return 0;
}



Replace your old .cpp files with the attached ones and do a clean build (delete your 'obj/' dir)

FB Alpha Enhanced R10 is done with the updated CPS3 driver but I haven't packaged it so it will be out in some minutes ^^

ThanX to IQ_132 for helping me understand how the patching works, we weren't able to do a fast boot for other NOCD games, because of that we couldn't patch other CPS3 to other regions. Maybe OopsWare can do a fast boot for other games so they can be changed of region too ^^ 

SeeYaa!
 :biggrin:

Offline KOF2112

  • Expert
  • *****
  • Posts: 187
  • Karma: +14/-4
Re: CPS-III driver preview
« Reply #21 on: December 28, 2007, 09:36:36 PM »
 :biggrin:
thank you CaptainCPS-X  updated CPS-III driver

Offline OopsWare

  • Expert
  • *****
  • Posts: 38
  • Karma: +31/-0
Re: CPS-III driver preview
« Reply #22 on: December 28, 2007, 09:56:36 PM »
Well done !!! CaptainCPS-X ,
follow your link http://www.mameworld.net/maws/romset/redeartn, i found this:

A0810000:001FEDB:00000001:0000000F      Japan
A0810000:001FEDB:00000002:0000000F     Asia
A0810000:001FEDB:00000003:0000000F     Euro
A0810000:001FEDB:00000004:0000000F     USA
A0810000:001FEDB:00000005:0000000F     Hispanic
A0810000:001FEDB:00000006:0000000F     Brazil
A0810000:001FEDB:00000007:0000000F     Oceania
A0810000:001FEDB:00000008:0000000F     Asia (NCD)

so , i think we needn't each bios files, we can write some hack code like you post.
or set them as a DIP switch .

to iq_132:
  thanx for your advice for ASM sh2 core . but my x86 asm realy bad .
but i wanta modify it's opcode analyze function, add a jumptable like MUSASHI 86K core.
in fact , that asm sh2 core is doing so .


Offline OopsWare

  • Expert
  • *****
  • Posts: 38
  • Karma: +31/-0
Re: CPS-III driver preview
« Reply #23 on: December 28, 2007, 11:33:39 PM »
sfiii2's coderegoin doesn't encrypt, so fast boot mode change to:
Code: [Select]
static int Cps3Reset()
{
// re-map cram_bank
cram_bank = 0;
Sh2MapMemory((unsigned char *)RamCRam, 0x04100000, 0x041fffff, SM_RAM);

#if 0
Sh2Reset( *(unsigned int *)(RomBios + 0), *(unsigned int *)(RomBios + 4) );
#else
// fast boot
if (cps3_isSpecial)
// sfiii2 only
Sh2Reset( *(unsigned int *)(RomGame + 0), *(unsigned int *)(RomGame + 4) );
else
Sh2Reset( *(unsigned int *)(RomGame_D + 0), *(unsigned int *)(RomGame_D + 4) );
Sh2SetVBR(0x06000000);
#endif
......

ok, let us make some test:
add some code after cps3_decrypt_bios(); in cps3Init()

Code: [Select]
......
be_to_le( RomBios, 0x080000 );
cps3_decrypt_bios();

unsigned int a1 = *(unsigned int *)( RomBios + 0x01fed8 );
unsigned int m1 = cps3_mask(0x01fed8, cps3_key1, cps3_key2);
bprintf(0, _T("%08x ^ %08x = %08x\n"), a1 ^ m1, m1, a1 );

.....

we'll got
fda7ee86 ^ ce87ce87 = 33202001   : redearth   : Japan
fda7ee84 ^ ce87ce87 = 33202003   : warzard    : Euro

so :
Asia (NCD) 33202008 ^ ce87ce87 = fda7ee8f
now we copy the bios file warzard_euro.29f400.u2 to redearth_nocd.bios
edit redearth_nocd.bios by a hex edit tools at offset 0x01fedb with value 0x8f

compress the redearth_nocd.bios to redeartn.zip update the crc in d_cps3.cpp

done !!! we got the redearth_nocd.bios ^^


 



Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #24 on: December 29, 2007, 12:10:22 AM »
Nicee!!! Gonna try that asap! ^^ ThanX OopsWare! Good Job!!  :wink:

SeeYaa!
 :biggrin:

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #25 on: December 29, 2007, 03:14:57 AM »
I was able to patch 'sfiii2n' using something similar to what I did for 'redeartn' to make the temporary clones and look the results with different values...

(The first picture is without the region patching, using only the code posted by OopsWare, other pictures are when using my region patching)










I couldn't find a patch value to get 'Hispanic' btw, here is the code for reference of my tests (redeartn code is commented because I removed the temporary clones I was testing, there should be a Dipswitch option later that let the user select what region to set for the game but I dont know to much how that interface works):

Quote

   // REDEARTN *****************************************************************************************************
   //
   // 0x06000000 - JAPAN (WARZARD)
   // 0x05000000 - ASIA
   // 0x04000000 - EURO
   // 0x03000000 - USA
   // 0x02000000 - HISPANIC
   // 0x01000000 - BRAZIL
   // 0x00000000 - OCEANIA
   /*
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redeartn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x05000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearen")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x04000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearun")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x03000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearhn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x02000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearbn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x01000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearon")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x00000000; }
   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redearjn")) { *((unsigned int *)(RomBios + 0x1FED8)) = 0x06000000; }
   */
   //

   // SFIII2N ******************************************************************************************************
   //
   // 0x00000000 - ASIA (NOCD)
   // 0x01000000 - EURO
   // 0x02000000 - NO REGION (WHITE)
   // 0x03000000 - JAPAN
   // 0x04000000 - BRAZIL
   // 0x05000000 - OCEANIA
   // 0x06000000 - USA
   // 0x07000000 - USA
   // 0x08000000 - ASIA

   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "sfiii2n")) { *((unsigned int *)(RomBios + 0x1FEC8)) ^= 0x00000000; }

   // **************************************************************************************************************



btw, the reset code in my build is like this now  :smilie: :

Quote

static int Cps3Reset()
{
   // re-map cram_bank
   cram_bank = 0;
   Sh2MapMemory((unsigned char *)RamCRam, 0x04100000, 0x041fffff, SM_RAM);

   if (!strcmp(BurnDrvGetTextA(DRV_NAME), "redeartn") || (cps3_isSpecial && !strcmp(BurnDrvGetTextA(DRV_NAME), "sfiii2n")))
   {
      // fast boot
      if (cps3_isSpecial && !strcmp(BurnDrvGetTextA(DRV_NAME), "sfiii2n"))
      {
         // sfiii2 only
         Sh2Reset( *(unsigned int *)(RomGame + 0), *(unsigned int *)(RomGame + 4));
         Sh2SetVBR(0x06000000);
      } else {
         // redeartn only
         Sh2Reset( *(unsigned int *)(RomGame_D + 0), *(unsigned int *)(RomGame_D + 4));
         Sh2SetVBR(0x06000000);
      }
   } else {
      Sh2Reset( *(unsigned int *)(RomBios + 0), *(unsigned int *)(RomBios + 4));
   }
   
   cps3_flash_init( &main_flash );   
   cps3_current_eeprom_read = 0;   
   cps3SndReset();   
   cps3_reset = 0;

   return 0;
}



EDIT: And this is my current redeartn driver with the nocd bios (obtained like OopsWare mentioned in his previous post  :wink:)

Quote

// Red Earth (961121, NO CD) ASIA
static struct BurnRomInfo redeartnRomDesc[] = {

   { "redearth_nocd.bios",
                 0x080000, 0xDB09F27C, BRF_ESS | BRF_BIOS },   // SH-2 Bios


   { "10",           0x800000, 0x68188016, BRF_ESS | BRF_PRG },   // SH-2 Code
   
   { "30",           0x800000, 0x074cab4d, BRF_GRA },
   { "31",           0x800000, 0x14e2cad4, BRF_GRA },
   { "40",           0x800000, 0x72d98890, BRF_GRA },
   { "41",           0x800000, 0x88ccb33c, BRF_GRA },
   { "50",           0x400000, 0x2f5b44bd, BRF_GRA },
};

STD_ROM_PICK(redeartn);
STD_ROM_FN(redeartn);



I will let you know if in my particular case I will add sfiii2n clones 'temporary' like I did for 'redeartn', I will get some sleep now and when I get back depending on the WIP that OopsWare have I let you know.

SeeYaa!
 :biggrin:
« Last Edit: February 01, 2010, 09:01:20 AM by CaptainCPS-X »

Offline KOF2112

  • Expert
  • *****
  • Posts: 187
  • Karma: +14/-4
Re: CPS-III driver preview
« Reply #26 on: December 29, 2007, 03:33:47 AM »
 :biggrin:
Thanks OopsWare Help

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #27 on: December 29, 2007, 03:08:52 PM »
I have been doing some work again and added "all" working including 'Hispanic' clones (I like to call them fake clones) with new and updated patching code, I have every CPS3 NOCD game region values to patch them, and their fake clone drivers are being done as I post this.

This is my current wip...



I will take a break for some minutes to be with my family and then I come back to finish adding 'all' clone drivers for the other CPS3 games  :smilie:

SeeYaa!
:biggrin:
« Last Edit: February 01, 2010, 09:01:52 AM by CaptainCPS-X »

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS-III driver preview
« Reply #28 on: December 29, 2007, 03:53:29 PM »
Updated the picture I posted before, I missed to add 'Oceania' region, now in the new picture is shown in both 'sfiiin' fake clones and 'sfiii2n' fake clones, so they are complete and working fine  :smilie:.

Please refresh (F5) the page to make sure your are looking at the updated image. Now I'm gonna take a break :p

SeeYaa!
 :biggrin:

Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: CPS-III driver preview
« Reply #29 on: December 29, 2007, 03:55:33 PM »
Fantastic the work done in so few time...Thanks  :biggrin:

PS : The sound not yet emulated...Any progress in this way?