Author Topic: CPS driver cleanup  (Read 44313 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
CPS driver cleanup
« on: April 14, 2007, 08:00:03 PM »
Quote
1.08
Added new ddtodj set
Renamed old ddtodj to ddtodjr1
Renamed old ddtodjr1 to ddtodjr2


1.07

Renamed ecofghtu to ecofgtu1
Added new ecofghtu set
Clear main & gfx RAM on reset (fixes gfx glitches)


1.06

Fixed hsf2j (thanks doomking)


1.05

General:

Renamed driver files to be more in line with standard naming in FBA
 - dc_cps1.cpp and dc_cps2.cpp are now d_cps1.cpp and d_cps2.cpp, respectively
Changed how which system is being emulated is found (Leaf)
Re-ported cps2_crpt.c for use in FBA, as the key format has changed
 - Also fixed problem with missing "bit" definition (CaptainCPS-X)

d_cps1.cpp:

Added ffightu (US)
 - Renamed ffightu to ffightua (US 900112)
 - Renamed ffightua to ffightub (US 900613)

d_cps2.cpp:

Added 19xxb (Brazil 951218)

Added dimahoo (Euro 000121)
 - Renamed dimahoo to dimahoou (USA 000121)

Set mmancp2u (USA 951006) to "Working"
Set rmancp2j (Japan 950922) to "Working"

Added nwarr (Euro 950316)
 - Renamed nwarr to nwarru (USA 950406)

Added sfa3 (Euro 980904)
 - Renamed sfa3 to sfa3u (USA 980904)
 - Renamed sfa3r1 to sfa3ur1 (USA 980629)

Added xmcotaj (Japan 941222)
 - Renamed xmcotaj to xmcotaj1 (Japan 941219)
 - Renamed xmcotaj1 to xmcotaj2 (Japan 941217)



1.01

 Fixed 'BIT' definition



Version 1.00

    * All CPS-1 drivers (and CPS Changer) are now in dc_cps1.cpp
    * All CPS-2 drivers are now in dc_cps2.cpp
    * Drivers should match MAME very closely (perfectly?)
    * Drivers are in the same order as cps1.c and cps2.c in the MAME source, so editing back and forth should be easy
    * All drivers are now >>extremely<< clean
    * All CPS drivers share a common init
    * CPS games with special init code have a callback (like neogeo)
    * CPS games get some important info from a table (ripped from MAME).
    * Individual Kludge names are now Kludge, 1, 2, 3...
    * Lots of CPS-1 & CPS-2 code has been merged
    * Removed dc_input.cpp, moved all of that into dc_cps2.cpp



+154
« Last Edit: November 02, 2007, 01:07:02 PM by iq_132 »


Offline Death Metal

  • Member
  • ***
  • Posts: 121
  • Karma: +3/-0
  • Crimson Blade
Re: CPS driver cleanup
« Reply #1 on: April 14, 2007, 09:04:03 PM »
Excelent. Sometimes I also endeavor into things like that (code clean-ups), but I'm sure yours must be incomparably much more well-done.

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: CPS driver cleanup
« Reply #2 on: April 14, 2007, 09:52:48 PM »
I don't know about incomparably better, but I did go absolutely 'OCD' on the drivers themselves.  Everything else feels a bit messy to me yet, but I'm not entirely sure I'd ever be happy with it, so I decided to just release what I have. :S
I have a few other projects that I'm going to try and post in the next few weeks (as I get time), this is just the first on my list.


Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS driver cleanup
« Reply #3 on: April 15, 2007, 01:11:42 AM »
Man, nice stuff!!,...now I feel like helping but first I have to finish the things im working on :p lol...(btw, I had to click on the link 'OCD' xDD)

SeeYaa!
 :biggrin:

Offline BisonSAS

  • Expert
  • *****
  • Posts: 210
  • Karma: +27/-0
  • [NGBRT]
    • NeoGeo BR Team
Re: CPS driver cleanup
« Reply #4 on: April 15, 2007, 07:30:37 AM »
Very good work! :smilie:

Offline Leaf

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +9/-4
Re: CPS driver cleanup
« Reply #5 on: April 15, 2007, 08:43:33 AM »
Great work, iq_132. Now the code is similar to MAME. :biggrin:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: CPS driver cleanup
« Reply #6 on: April 18, 2007, 10:46:16 PM »
Just wanted to let people know of a small update I added to the first post.  If you were getting a compile error regarding 'bit', the instructions to fix it are there.


Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS driver cleanup
« Reply #7 on: April 19, 2007, 12:51:30 AM »
I need a little help because I was adding your update to FBA Extras, first it was telling me the error I told you on the MSN and the updated code fixed it, but now i noticed other problem, it compiles fine and all but when i try to play any cps2 game it display a error like 'There was a problem starting 'Eco Fighters (World 931203)' or other cps2 game.

First I thought this was because by some of my modified code in some of the files but, then I made a clean FBA build with the latest official source and it gave me the same error, ...I dont know if im missing something but here is what i did...

1st - Extracted the FBA source (fba_src_029671)
2nd - Modified the makefile removing all dc_<driver name>.o, dc_inputs.o and added dc_cps1.o, dc_cps2.o
3rd - Added #define BIT(x,n) (((x)>>(n))&1) to the end of bitswap.h

that's it, then I compiled it...maybe there's something that need to be modified in other place too, but for now I dont know  :redface:

I hope this can be fixed, or revised by someone else to check if they get the same error.

ThanX in advance IQ! SeeYaa!
 :biggrin:
« Last Edit: April 19, 2007, 12:54:14 AM by CaptainCPS-X »

Offline Leaf

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +9/-4
Re: CPS driver cleanup
« Reply #8 on: April 19, 2007, 01:59:37 AM »
I need a little help because I was adding your update to FBA Extras, first it was telling me the error I told you on the MSN and the updated code fixed it, but now i noticed other problem, it compiles fine and all but when i try to play any cps2 game it display a error like 'There was a problem starting 'Eco Fighters (World 931203)' or other cps2 game.

You should modified the CPS2 flag in burn.h, this is different with it in official src. :biggrin:
Quote
#define HARDWARE_CAPCOM_CPS1      (HARDWARE_PREFIX_CAPCOM | 0x00010000)
#define HARDWARE_CAPCOM_CPS1_QSOUND (HARDWARE_PREFIX_CAPCOM | 0x00020000)
#define HARDWARE_CAPCOM_CPS1_GENERIC (HARDWARE_PREFIX_CAPCOM | 0x00030000)
#define HARDWARE_CAPCOM_CPSCHANGER   (HARDWARE_PREFIX_CAPCOM | 0x00040000)
#define HARDWARE_CAPCOM_CPS2      (HARDWARE_PREFIX_CPS2 | 0x00050000)

because it's used in CpsInit(),
Quote
   // figure out what system we're looking at
   {
      int flag = (BurnDrvGetHardwareCode() >> 16) & 7;

      if (flag <= 3) Cps = 1; // Cps 1
      if (flag == 4) Cps = 3; // Cps Changer (Cps 1)
      if (flag >= 5) Cps = 2; // Cps 2
   }

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS driver cleanup
« Reply #9 on: April 19, 2007, 02:26:59 AM »
You should modified the CPS2 flag in burn.h, this is different with it in official src. :biggrin:
because it's used in CpsInit(),

ThanX Leaf!, that fixed the issue  :wink:...

btw, I would have modified it, but it was unknown to me that flag was changed and there was no problem in the compilation.

SeeYaa!
 :biggrin:

Offline Leaf

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +9/-4
Re: CPS driver cleanup
« Reply #10 on: April 19, 2007, 03:04:54 AM »
hmmm...I think it will not.
But you can modify it like this,
Code: [Select]
// figure out what system we're looking at
{
int flag = (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK);

switch (flag) {
case HARDWARE_CAPCOM_CPS1:
case HARDWARE_CAPCOM_CPS1_GENERIC:
case HARDWARE_CAPCOM_CPS1_QSOUND:
Cps = 1;
break;

case HARDWARE_CAPCOM_CPSCHANGER:
Cps = 3;
break;

case HARDWARE_CAPCOM_CPS2:
Cps = 2;
break;
}
}

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS driver cleanup
« Reply #11 on: April 19, 2007, 03:34:47 AM »
hmmm...I think it will not.
But you can modify it like this,
Code: [Select]
// figure out what system we're looking at
{
int flag = (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK);

switch (flag) {
case HARDWARE_CAPCOM_CPS1:
case HARDWARE_CAPCOM_CPS1_GENERIC:
case HARDWARE_CAPCOM_CPS1_QSOUND:
Cps = 1;
break;

case HARDWARE_CAPCOM_CPSCHANGER:
Cps = 3;
break;

case HARDWARE_CAPCOM_CPS2:
Cps = 2;
break;
}
}

lol, it was working allready, but ThanX I will try it out  :biggrin:

SeeYaa!
 :biggrin:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: CPS driver cleanup
« Reply #12 on: September 11, 2007, 10:32:10 PM »
Updated!

Check the first post. ;)
« Last Edit: November 02, 2007, 12:47:40 PM by iq_132 »


Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: CPS driver cleanup
« Reply #13 on: September 11, 2007, 11:18:25 PM »
ThanX IQ! is cool to have this actual update ^^

I hope I can work on FBA again in the future (not too far future I hope lol :p)...

SeeYaa!
 :biggrin:

Offline lxd_bruce

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +1/-0
Re: CPS driver cleanup
« Reply #14 on: October 10, 2007, 05:13:33 AM »
I found a bug of running hsf2j .
when selecting Feilong to play, FBA will stop and return to windows. :redface: