Author Topic: cthd2003 and kof10th in AES mode ?  (Read 21481 times)

Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
cthd2003 and kof10th in AES mode ?
« on: April 18, 2006, 09:23:16 AM »
Hello

I have a probleme with this two games (and clones) in home mode:

chd2003:
-don't start with aes bios in the the last release of Mameplus
-don't get the home mode with the neogeo_hacks de MamePlus and europe bios v2

kof10th:
-dont get home mode with the neogeo_hacks de MamePlus and europe bios v2
-dont get home mode with the aes bios

could someone help me?  :redface:

I already apply this patch (removed from mameplus sources) in machine/neoprot.c for the others games who dont past the advert. It works great  :smilie:
Quote
/************************ AES Patchs************************
  To allow console mode
***************************************************************/

void mslug4_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0xad8c >> 1] = 0x4e75;
}

void rotd_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0x1020 >> 1] = 0x4e71;
   mem16[0x2400 >> 1] = 0x4e71;
}

void matrim_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0x1050 >> 1] = 0x4e75;
}

void mslug5_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0x122A >> 1] = 0x4e75;
}

void zupapa_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0x80290 >> 1] = 0x4e71;
}

void sengoku3_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0x00d04 >> 1] = 0x4e71;
}

void nitd_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0x19978 >> 1] = 0x4e75;
}

void kof2000_AES_protection(void)
{
   /* Patch out loop to disable console mode */
   UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
   mem16[0xa226e >> 1] = 0x4e75;
}
in includes/neogeo.h
Quote
void sengoku3_AES_protection(void);
void kof2000_AES_protection(void);
void mslug4_AES_protection(void);
void nitd_AES_protection(void);
void zupapa_AES_protection(void);
void rotd_AES_protection(void);
void matrim_AES_protection(void);
void mslug5_AES_protection(void);
and in drivers/neogeo.c (nitd for exemple)
Quote
DRIVER_INIT( nitd )
{
   neogeo_fix_bank_type = 1;
   kof99_neogeo_gfx_decrypt(0xff);
   init_neogeo();
   /* AES Patch */
   nitd_AES_protection();
}
I found this here (thanks): http://neo-source.com/index.php?topic=221.0

I also have an other probleme with kof10th who only works with 2 coins slots  :p

Thanks in advance for the help
« Last Edit: April 18, 2006, 09:35:15 AM by Nsk »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3723
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: cthd2003 and kof10th in AES mode ?
« Reply #1 on: April 18, 2006, 07:31:05 PM »
I donno about cthd2003, but kof10th is always in MVS mode (it was hacked to be that way).
The problem with the slots is probably related to that as well.


Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #2 on: April 18, 2006, 09:16:35 PM »
thanks for the answer

I think so but, but with the uni-bios and the cheat dat they can run fine in aes mode.  :p
Is there possible to had the patch in the code?

Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Re: cthd2003 and kof10th in AES mode ?
« Reply #3 on: April 20, 2006, 07:19:06 AM »
I have 1 question. Why do you want to use the non-arcade AES cart bio to use on the MVS Neo-Geo arcade games? None of those are non-arcade AES Neo-Geo games. :biggrin:

I always stick with the MVS bios.
« Last Edit: April 20, 2006, 07:20:48 AM by KingHanco »

Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #4 on: April 20, 2006, 10:49:29 AM »
I have doing a AES version of MAME, and they are the only tho games that dont get the AES mode.

I search why cthd2003 doesn't start since the last versions of MAME with the AES bios.

Before cthd2003 only give the arcade mode (like kof10th) but he started and today not (the code have been splited but it's the same: I don't anderstand ??)

I know it isn't very important but if someone can help  :smilie:

Thanks

Offline iq_132

  • Administrator
  • *****
  • Posts: 3723
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: cthd2003 and kof10th in AES mode ?
« Reply #5 on: April 20, 2006, 01:37:47 PM »
Ok, I figured out why cthd2003 (and it's hacks) stopped working.  In AES mode, these trigger the watchdog at some point, resetting the game & giving a black screen.

Here are some patches to fix that. :)

FBA:
Code: [Select]
// Fix for AES mode (stop loop that triggers watchdog)
*((unsigned short*)(Neo68KROM + 0xA2B7E)) = 0x4E71;

MAME:
Code: [Select]
// Fix for AES mode (stop loop that triggers watchdog)
mem16[0xA2B7E/2] = 0x4E71;


I'll take a look at kof10th later.
« Last Edit: April 20, 2006, 01:41:16 PM by iq_132 »


Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #6 on: April 20, 2006, 03:05:01 PM »
Big thanks !!
I will try it.  :smilie:

Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #7 on: April 20, 2006, 07:53:13 PM »
ok I try it and cthd2003 start now with the aes bios. It still being in arcade mode but start thanks  :smilie:.
For kof10th the game start with the aes bios it's not a probleme (same probleme: in arcade mode only).

This is a good fix, it's probably impossible to make this games starting in aes mode without a cheat code  :rolleyes:

manny thanks for helping me to fix the start of cthd2003 annyway (and escuse me for my very poor english  :redface: )
« Last Edit: April 20, 2006, 07:54:35 PM by Nsk »

Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #8 on: May 01, 2006, 06:35:25 PM »
Hi

thanks to your help from this post and others I finiched my build you can find it here:
http://houba.pitufo.org/

The sources are full aivable there is a lot of adds from many others builds: enjoy  :smilie:
(it's a french site...  :redface:)

Aubrel
« Last Edit: May 01, 2006, 06:37:09 PM by Nsk »

Offline iq_132

  • Administrator
  • *****
  • Posts: 3723
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: cthd2003 and kof10th in AES mode ?
« Reply #9 on: September 06, 2006, 08:01:17 PM »
Looked at this a little more...

Code: [Select]
// Game sets itself to MVS & English mode, patch this out
*((unsigned short*)(Neo68KROM + 0xED00E)) = 0x4E71;
*((unsigned short*)(Neo68KROM + 0xED394)) = 0x4E71;

// Fix for AES mode (stop loop that triggers Watchdog)
*((unsigned short*)(Neo68KROM + 0xA2B7E)) = 0x4E71;

This allows AES mode without a cheat, however, the menu and a few other
things for AES mode is buggy (check kof2001 as it is buggy [unfinished?] like this also).
« Last Edit: September 06, 2006, 08:03:30 PM by iq_132 »


Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #10 on: September 29, 2006, 06:55:11 PM »
Big thanks to work on it  :wink:

I finaly give a freeplay mode to these games. It works great  :cool:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3723
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: cthd2003 and kof10th in AES mode ?
« Reply #11 on: September 30, 2006, 05:15:06 AM »
NP, as promised (a long time ago), here's a fix for kof10th

It was difficult to figure this out because the program code for it
is protected (xored) and swapped in dynamically (in the 0xe0000 range),
and it isn't a usual type of write that bootleg authors do, it sets an
address range, then moves a byte into an offset in the address range (simply).
After I realized that the code for this was in this range (thanks to Raz!),
I looked at where it was coming from (thanks again to Raz!).  I then took
a nop (4e71) and xored it by the correct values (again, Raz!) to make it
work correctly as the game was ran.

Code: [Select]
/*
000e0022   6100 0042                        BSR       B_66
000e0026   47f9 0010 fd00                   LEA       A_0010fd00,A3
000e002C   177c 0080 0082                   MOVE.B    #0x0080,(D_0082,A3)
000e0032   0c2b 0080 0082                   CMP.B     #0x80,(D_0082,A3)
000e0038   66f2                             BNE       B_2c
*/
  *((unsigned short*)(Neo68KROM + 0x053162c)) = 0x7425; // MOVE.B (xored NOP)
//*((unsigned short*)(Neo68KROM + 0x0531632)) = 0x98AA; // CMP.B  (xored NOP)
//*((unsigned short*)(Neo68KROM + 0x0531638)) = 0x4E09; // BNE    (xored NOP)
/*
000e003A   177c 0001 0083                   MOVE.B    #0x0001,(D_0083,A3)
000e0040   0c2b 0001 0083                   CMP.B     #0x1,(D_0083,A3)
000e0046   66f2                             BNE       B_3a
*/
  *((unsigned short*)(Neo68KROM + 0x053163A)) = 0x8084; // MOVE.B (xored NOP)
//*((unsigned short*)(Neo68KROM + 0x0531640)) = 0xBE38; // CMP.B  (xored NOP)
//*((unsigned short*)(Neo68KROM + 0x0531646)) = 0x7925; // BNE    (xored NOP)
/*
// Do these need to be patched as well??
000e0048   177c 0000 008c                   MOVE.B    #0x0000,(D_008c,A3)
000e004E   0c2b 0000 008c                   CMP.B     #0x0,(D_008c,A3)
000e0054   66f2                             BNE       B_48

000e0056   177c 0003 008f                   MOVE.B    #0x0003,(D_008f,A3)
000e005C   0c2b 0003 008f                   CMP.B     #0x3,(D_008f,A3)
000e0062   66f2                             BNE       B_56
000e0064   4e75                             RTS
*/

The only lines of code you really need are these two. 
The rest above are just for informational purposes.
Also, these patches DO NOT make the game fail the UNIBIOS crc check.

// FBA
Code: [Select]
  *((unsigned short*)(Neo68KROM + 0x053162C)) = 0x7425; // Fix System
  *((unsigned short*)(Neo68KROM + 0x053163A)) = 0x8084; // Fix Region

// MAME
Code: [Select]
  ((UINT16*)src)[0x053162C/2] = 0x7425; // Fix System
  ((UINT16*)src)[0x053163A/2] = 0x8084; // Fix Region
« Last Edit: September 30, 2006, 05:51:15 AM by iq_132 »


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Re: cthd2003 and kof10th in AES mode ?
« Reply #12 on: October 03, 2006, 10:55:59 AM »
Thanks IQ :)
IQ Forum Member

Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #13 on: October 03, 2006, 02:39:42 PM »
Big Thnaks!!!

I will try this thanks!

Offline Nsk

  • Newbies
  • *
  • Posts: 31
  • Karma: +0/-0
Re: cthd2003 and kof10th in AES mode ?
« Reply #14 on: October 04, 2006, 01:07:00 PM »
I have try this patchs  :smilie:

cthd2003 and clones work now in aes mode (like original kof2001 so with garbage on menu) but great: thanks!!

kof10th works great in aes mode with this patch but in arcade mode it make the game in "single play" in order to "team play" and remove the "credits watching" but it force 1coin slot so it's a very good :smilie:
"team play" and "credit" could be activated in service but do you have an idea for reactivate them by default?

so this patch doesn't work with kof10th clones.

So if you know how to activate team and credit in arcade mode with kof10...  :rolleyes:

Big thanks for all !!  :smilie: