From: Atari Ace [mailto:atari_ace@verizon.net]

Subject: [patch] Fix namcos2 multisession crash

Hi mamedev,

If you run a namcos2 game multi-session (say marvland), it may crash
due to an inappropriate use of auto_malloc.  Fix attached.

~aa
This commit is contained in:
Aaron Giles 2008-02-19 09:23:43 +00:00
parent 1f7c87ec68
commit 62754695d7

View file

@ -94,10 +94,13 @@ ResetAllSubCPUs( int state )
}
}
MACHINE_RESET( namcos2 ){
MACHINE_RESET( namcos2 )
{
int loop;
mFinalLapProtCount = 0;
namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
/* Initialise the bank select in the sound CPU */
namcos2_sound_bankselect_w(0,0); /* Page in bank 0 */
@ -121,10 +124,6 @@ MACHINE_RESET( namcos2 ){
NVRAM_HANDLER( namcos2 )
{
if( !namcos2_eeprom )
{
namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
}
if( read_or_write )
{
mame_fwrite( file, namcos2_eeprom, namcos2_eeprom_size );