From b3a01131b77c07ed034c75611105285293b992f8 Mon Sep 17 00:00:00 2001 From: Phil Bennett Date: Mon, 25 Jan 2010 14:42:18 +0000 Subject: [PATCH] Ensure that RAM and bitmaps are cleared when the ms32 driver is started to avoid 64-bit build crashes [David Haywood] ---------- Forwarded message ---------- From: David Haywood Date: Thu, Jan 21, 2010 at 10:04 PM Subject: ms32 ram clearing To: Philip Bennett this ensures that ram and bitmaps are cleared when the ms32 driver is started, some games were crashing out on 64-bit otherwise due to bogus values. --- src/mame/video/ms32.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c index 6e9c30b6072..7ed9bf1c618 100644 --- a/src/mame/video/ms32.c +++ b/src/mame/video/ms32.c @@ -105,13 +105,13 @@ VIDEO_START( ms32 ) int width = video_screen_get_width(machine->primary_screen); int height = video_screen_get_height(machine->primary_screen); - ms32_priram_8 = auto_alloc_array(machine, UINT8, 0x2000); - ms32_palram_16 = auto_alloc_array(machine, UINT16, 0x20000); - ms32_rozram_16 = auto_alloc_array(machine, UINT16, 0x10000); - ms32_lineram_16 = auto_alloc_array(machine, UINT16, 0x1000); - ms32_sprram_16 = auto_alloc_array(machine, UINT16, 0x20000); - ms32_bgram_16 = auto_alloc_array(machine, UINT16, 0x4000); - ms32_txram_16 = auto_alloc_array(machine, UINT16, 0x4000); + ms32_priram_8 = auto_alloc_array_clear(machine, UINT8, 0x2000); + ms32_palram_16 = auto_alloc_array_clear(machine, UINT16, 0x20000); + ms32_rozram_16 = auto_alloc_array_clear(machine, UINT16, 0x10000); + ms32_lineram_16 = auto_alloc_array_clear(machine, UINT16, 0x1000); + ms32_sprram_16 = auto_alloc_array_clear(machine, UINT16, 0x20000); + ms32_bgram_16 = auto_alloc_array_clear(machine, UINT16, 0x4000); + ms32_txram_16 = auto_alloc_array_clear(machine, UINT16, 0x4000); ms32_tx_tilemap = tilemap_create(machine, get_ms32_tx_tile_info,tilemap_scan_rows,8, 8,64,64); ms32_bg_tilemap = tilemap_create(machine, get_ms32_bg_tile_info,tilemap_scan_rows,16,16,64,64); @@ -124,6 +124,9 @@ VIDEO_START( ms32 ) temp_bitmap_sprites = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16); temp_bitmap_sprites_pri = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16); // not actually being used for rendering, we embed pri info in the raw colour bitmap + bitmap_fill(temp_bitmap_tilemaps,0,0); + bitmap_fill(temp_bitmap_sprites,0,0); + bitmap_fill(temp_bitmap_sprites_pri,0,0); tilemap_set_transparent_pen(ms32_tx_tilemap,0); tilemap_set_transparent_pen(ms32_bg_tilemap,0); @@ -149,7 +152,7 @@ VIDEO_START( f1superb ) { VIDEO_START_CALL( ms32 ); - f1superb_extraram_16 = auto_alloc_array(machine, UINT16, 0x10000); + f1superb_extraram_16 = auto_alloc_array_clear(machine, UINT16, 0x10000); ms32_extra_tilemap = tilemap_create(machine, get_ms32_extra_tile_info,tilemap_scan_rows,2048,1,1,0x400); }