Submission from Johnboy for Mame v0.127u7 mainline

Affected files:

	mame\src\mame\drivers\neodrvr.c
	mame\src\mame\includes\neogeo.h
	mame\src\mame\machine\neoboot.c
	mame\src\mame\machine\neoprot.c

Changes:
 . Completed general cleanup
	Sorting OEM / bootleg sets
	Renaming roms on non OEM / bootleg sets to ONE naming sheme
	Renamed functions
	Cleaned up bootleg sets
	Added some comments
	Renamed sma in garou/garouo, added comment
This commit is contained in:
davidhay 2008-10-10 07:29:33 +00:00
parent 33f6cb5d84
commit 6d8fbd09cf
4 changed files with 706 additions and 644 deletions

File diff suppressed because it is too large Load Diff

View File

@ -64,12 +64,11 @@ void kof2003_decrypt_68k(running_machine *machine);
void kof2003h_decrypt_68k(running_machine *machine); void kof2003h_decrypt_68k(running_machine *machine);
void kof2003biosdecode(running_machine *machine); void kof2003biosdecode(running_machine *machine);
void samsh5sp_decrypt_68k(running_machine *machine); void samsh5sp_decrypt_68k(running_machine *machine);
void neo_pcm2_snk_1999(running_machine *machine, int value); void neo_pcm2_snk_1999(running_machine *machine, int value);
void neo_pcm2_swap(running_machine *machine, int value); void neo_pcm2_swap(running_machine *machine, int value);
void neogeo_cmc50_m1_decrypt(running_machine *machine); void neogeo_cmc50_m1_decrypt(running_machine *machine);
/*----------- defined in machine/neoprot.c -----------*/ /*----------- defined in machine/neoprot.c -----------*/
void neogeo_reset_rng(void); void neogeo_reset_rng(void);
@ -111,11 +110,11 @@ void svcplus_px_hack(running_machine *machine);
void svcplusa_px_decrypt(running_machine *machine); void svcplusa_px_decrypt(running_machine *machine);
void svcsplus_px_decrypt(running_machine *machine); void svcsplus_px_decrypt(running_machine *machine);
void svcsplus_px_hack(running_machine *machine); void svcsplus_px_hack(running_machine *machine);
void kof2003b_px_decrypt(running_machine *machine); void kf2k3bl_px_decrypt(running_machine *machine);
void kof2003b_install_protection(running_machine *machine); void kf2k3bl_install_protection(running_machine *machine);
void kof2k3pl_px_decrypt(running_machine *machine); void kf2k3pl_px_decrypt(running_machine *machine);
void kof2k3up_px_decrypt(running_machine *machine); void kf2k3upl_px_decrypt(running_machine *machine);
void kof2k3up_install_protection(running_machine *machine); void kf2k3upl_install_protection(running_machine *machine);
void kf2k3pl_install_protection(running_machine *machine); void kf2k3pl_install_protection(running_machine *machine);
void samsho5b_px_decrypt(running_machine *machine); void samsho5b_px_decrypt(running_machine *machine);
void samsho5b_vx_decrypt(running_machine *machine); void samsho5b_vx_decrypt(running_machine *machine);

View File

@ -18,6 +18,7 @@
/* General Bootleg Functions - used by more than 1 game */ /* General Bootleg Functions - used by more than 1 game */
void neogeo_bootleg_cx_decrypt( running_machine *machine ) void neogeo_bootleg_cx_decrypt( running_machine *machine )
{ {
int i; int i;
@ -34,6 +35,7 @@ void neogeo_bootleg_cx_decrypt( running_machine *machine )
free( buf ); free( buf );
} }
void neogeo_bootleg_sx_decrypt( running_machine *machine, int value ) void neogeo_bootleg_sx_decrypt( running_machine *machine, int value )
{ {
int sx_size = memory_region_length( machine, "fixed" ); int sx_size = memory_region_length( machine, "fixed" );
@ -62,9 +64,9 @@ void neogeo_bootleg_sx_decrypt( running_machine *machine, int value )
/* The King of Gladiator (The King of Fighters '97 bootleg) */ /* The King of Gladiator (The King of Fighters '97 bootleg) */
/* the protection patching here may be incomplete */
// Thanks to Razoola for the info /* The protection patching here may be incomplete
Thanks to Razoola for the info */
void kog_px_decrypt( running_machine *machine ) void kog_px_decrypt( running_machine *machine )
{ {
@ -127,7 +129,9 @@ void kog_px_decrypt( running_machine *machine )
} }
/* Kof 10th Anniversary (bootleg of King of Fighters 2002 */
/* The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg) */
/* this uses RAM based tiles for the text layer, however the implementation /* this uses RAM based tiles for the text layer, however the implementation
is incomplete, at the moment the S data is copied from the program rom on is incomplete, at the moment the S data is copied from the program rom on
@ -204,6 +208,10 @@ void decrypt_kof10th(running_machine *machine)
((UINT16*)src)[0x8bf8/2] = 0xf980; ((UINT16*)src)[0x8bf8/2] = 0xf980;
} }
/* The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg) */
void decrypt_kf10thep(running_machine *machine) void decrypt_kf10thep(running_machine *machine)
{ {
int i; int i;
@ -241,6 +249,10 @@ void decrypt_kf10thep(running_machine *machine)
free(sbuf); free(sbuf);
} }
/* The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg) */
static void kf2k5uni_px_decrypt( running_machine *machine ) static void kf2k5uni_px_decrypt( running_machine *machine )
{ {
int i, j, ofst; int i, j, ofst;
@ -286,7 +298,9 @@ void decrypt_kf2k5uni( running_machine *machine )
kf2k5uni_mx_decrypt(machine); kf2k5uni_mx_decrypt(machine);
} }
/* Kof2002 Magic Plus */
/* The King of Fighters 2002 Magic Plus (bootleg) */
void kf2k2mp_decrypt( running_machine *machine ) void kf2k2mp_decrypt( running_machine *machine )
{ {
@ -309,7 +323,8 @@ void kf2k2mp_decrypt( running_machine *machine )
free(dst); free(dst);
} }
/* Kof2002 Magic Plus 2 */
/* The King of Fighters 2002 Magic Plus II (bootleg) */
void kof2km2_px_decrypt( running_machine *machine ) void kof2km2_px_decrypt( running_machine *machine )
@ -328,6 +343,7 @@ void kof2km2_px_decrypt( running_machine *machine )
/* Crouching Tiger Hidden Dragon 2003 (bootleg of King of Fighters 2001) */ /* Crouching Tiger Hidden Dragon 2003 (bootleg of King of Fighters 2001) */
/* descrambling information from razoola */ /* descrambling information from razoola */
static void cthd2003_neogeo_gfx_address_fix_do(running_machine *machine, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift) static void cthd2003_neogeo_gfx_address_fix_do(running_machine *machine, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift)
{ {
@ -466,8 +482,10 @@ void patch_cthd2003( running_machine *machine )
mem16[0x9943e/2] = 0xdd03; mem16[0x9943e/2] = 0xdd03;
} }
/* Crouching Tiger Hidden Dragon 2003 Super Plus (bootleg of King of Fighters 2001) */ /* Crouching Tiger Hidden Dragon 2003 Super Plus (bootleg of King of Fighters 2001) */
static void ct2k3sp_sx_decrypt( running_machine *machine ) static void ct2k3sp_sx_decrypt( running_machine *machine )
{ {
int rom_size = memory_region_length( machine, "fixed" ); int rom_size = memory_region_length( machine, "fixed" );
@ -514,8 +532,10 @@ void decrypt_ct2k3sp( running_machine *machine )
cthd2003_c(machine, 0); cthd2003_c(machine, 0);
} }
/* Crouching Tiger Hidden Dragon 2003 Super Plus alternate (bootleg of King of Fighters 2001) */ /* Crouching Tiger Hidden Dragon 2003 Super Plus alternate (bootleg of King of Fighters 2001) */
void decrypt_ct2k3sa( running_machine *machine ) void decrypt_ct2k3sa( running_machine *machine )
{ {
UINT8 *romdata = memory_region(machine, "audio")+0x10000; UINT8 *romdata = memory_region(machine, "audio")+0x10000;
@ -570,8 +590,10 @@ void patch_ct2k3sa( running_machine *machine )
mem16[0x9943e/2] = 0xdd03; mem16[0x9943e/2] = 0xdd03;
} }
/* King of Fighters Special Edition 2004 (bootleg of King of Fighters 2002) */ /* King of Fighters Special Edition 2004 (bootleg of King of Fighters 2002) */
void decrypt_kof2k4se_68k( running_machine *machine ) void decrypt_kof2k4se_68k( running_machine *machine )
{ {
UINT8 *src = memory_region(machine, "main")+0x100000; UINT8 *src = memory_region(machine, "main")+0x100000;
@ -636,6 +658,10 @@ void lans2004_decrypt_68k( running_machine *machine )
rom[0xBBE42/2] = 0x6002; rom[0xBBE42/2] = 0x6002;
} }
/* Metal Slug 5 Plus (bootleg) */
static READ16_HANDLER( mslug5_prot_r ) static READ16_HANDLER( mslug5_prot_r )
{ {
logerror("PC %06x: access protected\n",activecpu_get_pc()); logerror("PC %06x: access protected\n",activecpu_get_pc());
@ -669,6 +695,8 @@ void install_ms5plus_protection(running_machine *machine)
} }
/* SNK vs. CAPCOM SVC CHAOS (bootleg) */
void svcboot_px_decrypt( running_machine *machine ) void svcboot_px_decrypt( running_machine *machine )
{ {
@ -691,8 +719,6 @@ void svcboot_px_decrypt( running_machine *machine )
free( dst ); free( dst );
} }
void svcboot_cx_decrypt( running_machine *machine ) void svcboot_cx_decrypt( running_machine *machine )
{ {
static const UINT8 idx_tbl[ 0x10 ] = { static const UINT8 idx_tbl[ 0x10 ] = {
@ -726,6 +752,8 @@ void svcboot_cx_decrypt( running_machine *machine )
} }
/* SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 1) */
void svcplus_px_decrypt( running_machine *machine ) void svcplus_px_decrypt( running_machine *machine )
{ {
@ -753,8 +781,6 @@ void svcplus_px_decrypt( running_machine *machine )
free( dst ); free( dst );
} }
void svcplus_px_hack( running_machine *machine ) void svcplus_px_hack( running_machine *machine )
{ {
/* patched by the protection chip? */ /* patched by the protection chip? */
@ -769,6 +795,10 @@ void svcplus_px_hack( running_machine *machine )
src[ 0x0f802c ] = 0x16; src[ 0x0f802c ] = 0x16;
} }
/* SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 2) */
void svcplusa_px_decrypt( running_machine *machine ) void svcplusa_px_decrypt( running_machine *machine )
{ {
int i; int i;
@ -786,6 +816,8 @@ void svcplusa_px_decrypt( running_machine *machine )
} }
/* SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg) */
void svcsplus_px_decrypt( running_machine *machine ) void svcsplus_px_decrypt( running_machine *machine )
{ {
@ -809,8 +841,6 @@ void svcsplus_px_decrypt( running_machine *machine )
free( dst ); free( dst );
} }
void svcsplus_px_hack( running_machine *machine ) void svcsplus_px_hack( running_machine *machine )
{ {
/* patched by the protection chip? */ /* patched by the protection chip? */
@ -838,13 +868,10 @@ static WRITE16_HANDLER( mv0_bankswitch_w )
} }
#endif #endif
/* I think the code for the kof2003 bootlegs is wrong, they don't work */
/*************************************************************************** /* The King of Fighters 2003 (bootleg set 1) */
kof2003b
****************************************************************************/
/* kof2003 bootleg init info */
static UINT16 kof2003_tbl[4096]; static UINT16 kof2003_tbl[4096];
static READ16_HANDLER( kof2003_r) static READ16_HANDLER( kof2003_r)
@ -887,7 +914,7 @@ static WRITE16_HANDLER( kof2003p_w )
} }
} }
void kof2003b_px_decrypt( running_machine *machine ) void kf2k3bl_px_decrypt( running_machine *machine )
{ {
int i; int i;
static const UINT8 sec[] = { static const UINT8 sec[] = {
@ -905,17 +932,16 @@ void kof2003b_px_decrypt( running_machine *machine )
free( buf ); free( buf );
} }
void kof2003b_install_protection(running_machine *machine) void kf2k3bl_install_protection(running_machine *machine)
{ {
memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w ); memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w );
} }
/*************************************************************************** /* The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg) */
kof2k3pl
***************************************************************************/
void kof2k3pl_px_decrypt( running_machine *machine )
void kf2k3pl_px_decrypt( running_machine *machine )
{ {
UINT16*tmp = malloc_or_die(0x100000); UINT16*tmp = malloc_or_die(0x100000);
UINT16*rom = (UINT16*)memory_region( machine, "main" ); UINT16*rom = (UINT16*)memory_region( machine, "main" );
@ -940,12 +966,10 @@ void kf2k3pl_install_protection(running_machine *machine)
} }
/*************************************************************************** /* The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg) */
kof2k3up
***************************************************************************/
void kof2k3up_px_decrypt( running_machine *machine ) void kf2k3upl_px_decrypt( running_machine *machine )
{ {
{ {
UINT8 *src = memory_region(machine, "main"); UINT8 *src = memory_region(machine, "main");
@ -967,7 +991,7 @@ void kof2k3up_px_decrypt( running_machine *machine )
} }
} }
void kof2k3up_install_protection(running_machine *machine) void kf2k3upl_install_protection(running_machine *machine)
{ {
memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w ); memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, kof2003_r, kof2003_w );
} }

View File

@ -110,10 +110,11 @@ void fatfury2_install_protection(running_machine *machine)
} }
/************************ King of Fighters 98******************* /************************ King of Fighters 98*******************
The encrypted set has a rom overlay feature, checked at The encrypted set has a rom overlay feature, checked at
various points in the game various points in the game.
Special board is used: NEO-MVS PROGSF1 (1998.6.17)
The board has a ALTERA (EPM7128SQC100-15) chip which is tied to 242-P1
***************************************************************/ ***************************************************************/
static WRITE16_HANDLER ( kof98_prot_w ) static WRITE16_HANDLER ( kof98_prot_w )
@ -149,9 +150,11 @@ void install_kof98_protection(running_machine *machine)
} }
/************************ Metal Slug X ************************* /************************ Metal Slug X *************************
todo: emulate, not patch! todo: emulate, not patch!
Special board is used: NEO-MVS PROGEOP (1999.2.2)
The board has a ALTERA (EPM7128SQC100-15) chip which is tied to 250-P1
Also found on this special board is a QFP144 labeled with 0103
***************************************************************/ ***************************************************************/
void mslugx_install_protection(running_machine *machine) void mslugx_install_protection(running_machine *machine)