Author Topic: Fatal Fury 2 bugs...  (Read 6879 times)

Offline NJ7

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-6
  • Member
Fatal Fury 2 bugs...
« on: August 17, 2004, 12:15:45 AM »
Can't hit the opponent after the first match and after the second the time is always up......the time is fixable if ya use the Universe Bios Infinite Time cheat, but the hitting opponent isn't.....anyone know how to fix this driver?

Offline NJ7

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-6
  • Member
Somethings gotta be wrong
« Reply #1 on: August 17, 2004, 03:41:29 AM »
I looked at the MAME source and the drivers were similar, but something has to be wrong with the protection scheme cause it don't work, anyone got the fix?

// Fatal Fury 2

static struct BurnRomInfo fatfury2RomDesc[] = {
   {"047-p1.bin"   , 0x080000, 0xbe40ea92, 0x10}, //  0 68K code
   {"047-p2.bin"   , 0x080000, 0x2a9beac5, 0x10}, //  1

   {"047-s1.bin"   , 0x020000, 0xd7dbbf39,    1}, //  2 Text layer tiles

   {"047-c1.bin"   , 0x200000, 0xf72a939e,    1}, //  3 Sprite data
   {"047-c2.bin"   , 0x200000, 0x05119a0d,    1}, //  4
   {"047-c3.bin"   , 0x200000, 0x01e00738,    1}, //  5
   {"047-c4.bin"   , 0x200000, 0x9fe27432,    1}, //  6

   {"047-m1.bin"   , 0x020000, 0x820b0ba7, 0x10}, //  7 Z80 code

   {"047-v1.bin"   , 0x200000, 0xd9d00784,    2}, //  8 Sound data
   {"047-v2.bin"   , 0x200000, 0x2c9a4b33,    2}, //  9
};

STDROMPICKEXT(fatfury2, fatfury2, neogeo);
STD_ROM_FN(fatfury2);

static int prot_data;

unsigned char __fastcall fatfury2ReadByteProtection(unsigned int sekAddress)
{
   unsigned short res = (prot_data >> 24) & 0xFF;

   switch (sekAddress) {
      case 0x255551:
      case 0x2FFFF1:
      case 0x200001:
      case 0x2FF001:
      case 0x236001:
      case 0x236009:
         return res;

      case 0x236005:
      case 0x23600D:
         return ((res & 0xF0) >> 4) | ((res & 0x0F) << 4);

//      default:
//         printf("  - prot %06X read", sekAddress);
   }

   return 0;
}

void __fastcall fatfury2WriteByteProtection(unsigned int sekAddress, unsigned char /*byteValue*/)
{
   switch (sekAddress) {
      case 0x255553:            // data == 0x5555; read back from 55550, ffff0, 00000, ff000
         prot_data = 0xFF00FF00;
         break;

      case 0x256783:            // data == 0x1234; read back from 36000 *or* 36004
         prot_data = 0xF05A3601;
         break;

      case 0x242813:            // data == 0x1824; read back from 36008 *or* 3600c
         prot_data = 0x81422418;
         break;

      case 0x255551:
      case 0x2FFFF1:
      case 0x2FF001:
      case 0x236001:
      case 0x236005:
      case 0x236009:
      case 0x23600D:
         prot_data <<= 8;
         break;

//      default:
//         printf("  - prot %06X -> %02X", sekAddress, byteValue);
   }
}

static void fatfury2Patch()
{
   *((unsigned short*)(Neo68KROM01 + 0xB820)) = 0x4E71;
   *((unsigned short*)(Neo68KROM01 + 0xB822)) = 0x4E71;
}

static int fatfury2Init()
{
   int nRet;

   pNeoInitCallback = fatfury2Patch;

   nRet = NeoInit();

   if (nRet == 0) {
      // Install protection handler
      SekMapHandler(5,   0x200000, 0x2FFFFF, SM_WRITE);
      SekSetWriteByteHandler(5, fatfury2WriteByteProtection);
      SekSetReadByteHandler(5, fatfury2ReadByteProtection);
   }

   return nRet;
}

struct BurnDriver BurnDrvFatfury2 = {
   {"fatfury2", "Fatal Fury 2", "Japanese title is: Garou Densetsu 2: arata-naru tatakai", "SNK", "Neo Geo", "1992", NULL, "neogeo"},
   BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SWAPC,
   NULL, fatfury2RomInfo, fatfury2RomName, neogeoInputInfo, neogeoDIPInfo,
   fatfury2Init, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
   nNeoScreenWidth, 224, 4, 3
};

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Fatal Fury 2 bugs...
« Reply #2 on: August 17, 2004, 04:42:50 PM »
I'm not pretty sure but maybe the memory values are wrong for FBA (?)... BTW it looks difficult to fix because is the SAME code as MAME so, it should work properly... but it doesn't.
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 iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Fatal Fury 2 bugs...
« Reply #3 on: August 17, 2004, 05:20:32 PM »
Quote from: FerchogtX
I'm not pretty sure but maybe the memory values are wrong for FBA (?)... BTW it looks difficult to fix because is the SAME code as MAME so, it should work properly... but it doesn't.
See ya!!!!! :D

Yeah, I noticed that too.  There's not one difference.  I remember Jan (FBA Dev) saying that the memory reading/writing stuff isn't set up correctly.