From 62754695d7be2af0e5fadad535b6a6b1b83398aa Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 19 Feb 2008 09:23:43 +0000 Subject: [PATCH] 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 --- src/mame/machine/namcos2.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c index 37e2c2a3cb0..cbfb453ae68 100644 --- a/src/mame/machine/namcos2.c +++ b/src/mame/machine/namcos2.c @@ -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 );