From 8c1e8e5aabce7b0cdf5fb68848b29b5c8f21279d Mon Sep 17 00:00:00 2001 From: Yasuhiro Ogawa Date: Thu, 26 Mar 2009 00:43:17 +0000 Subject: [PATCH] small ejsakura fix [Cs9ph7Rg0] --- src/mame/drivers/seibuspi.c | 9 +++++---- src/mame/video/seibuspi.c | 18 +++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c index 6fb03e3c387..9cee8377ce6 100644 --- a/src/mame/drivers/seibuspi.c +++ b/src/mame/drivers/seibuspi.c @@ -2206,6 +2206,7 @@ static DRIVER_INIT( sys386f2 ) UINT16 *src = (UINT16 *)memory_region(machine, "gfx3"); UINT16 tmp[0x40 / 2], Offset; + // sprite_reorder() only for(i = 0; i < memory_region_length(machine, "gfx3") / 0x40; i++) { memcpy(tmp, src, 0x40); @@ -3389,10 +3390,10 @@ ROM_START(ejsakura) /* SYS386F V2.0 */ ROM_REGION( 0x900000, "gfx2", ROMREGION_ERASEFF) /* background layer roms */ ROM_REGION( 0x1000000, "gfx3", 0) /* sprites */ - ROM_LOAD16_WORD_SWAP("chr1.442", 0x000000, 0x400000, CRC(40c6c238) SHA1(0d07b59e25632feb070ce0e572ae75f9bb939893) ) - ROM_LOAD16_WORD_SWAP("chr2.443", 0x400000, 0x400000, CRC(8e5d1de5) SHA1(c1ccb6b4341ee1e939958ec9e68280c6faa2ef1f) ) - ROM_LOAD16_WORD_SWAP("chr3.444", 0x800000, 0x400000, CRC(638dc9ae) SHA1(0c11b1e688733fbaeabf83b33410714c22ae53cd) ) - ROM_LOAD16_WORD_SWAP("chr4.445", 0xc00000, 0x400000, CRC(177e3139) SHA1(0385a831c141d59ec4e9c6d6fae9436dca123764) ) + ROM_LOAD16_WORD_SWAP("chr4.445", 0x000000, 0x400000, CRC(40c6c238) SHA1(0d07b59e25632feb070ce0e572ae75f9bb939893) ) + ROM_LOAD16_WORD_SWAP("chr3.444", 0x400000, 0x400000, CRC(8e5d1de5) SHA1(c1ccb6b4341ee1e939958ec9e68280c6faa2ef1f) ) + ROM_LOAD16_WORD_SWAP("chr2.443", 0x800000, 0x400000, CRC(638dc9ae) SHA1(0c11b1e688733fbaeabf83b33410714c22ae53cd) ) + ROM_LOAD16_WORD_SWAP("chr1.442", 0xc00000, 0x400000, CRC(177e3139) SHA1(0385a831c141d59ec4e9c6d6fae9436dca123764) ) ROM_REGION(0x1000000, "ymz", 0) ROM_LOAD("sound1.83", 0x000000, 0x800000, CRC(98783cfc) SHA1(f142429e0658a36e908cc135fe0e01ce853d071d) ) diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c index e5adb3ff816..d67f264516c 100644 --- a/src/mame/video/seibuspi.c +++ b/src/mame/video/seibuspi.c @@ -12,6 +12,7 @@ static UINT32 layer_bank; static UINT32 layer_enable; static UINT32 video_dma_length; static UINT32 video_dma_address; +static UINT32 sprite_dma_length; static int rf2_layer_bank[3]; static UINT32 *tilemap_ram; @@ -219,7 +220,7 @@ WRITE32_HANDLER( sprite_dma_start_w ) { if (video_dma_address != 0) { - memcpy( sprite_ram, &spimainram[(video_dma_address / 4) - 0x200], 0x1000); + memcpy( sprite_ram, &spimainram[(video_dma_address / 4) - 0x200], sprite_dma_length); } } @@ -371,7 +372,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta if( layer_enable & 0x10 ) return; - for( a = 0x400 - 2; a >= 0; a -= 2 ) { + for( a = (sprite_dma_length / 4) - 2; a >= 0; a -= 2 ) { tile_num = (sprite_ram[a + 0] >> 16) & 0xffff; if( sprite_ram[a + 1] & 0x1000 ) tile_num |= 0x10000; @@ -484,7 +485,6 @@ VIDEO_START( spi ) int i; int region_length; - sprite_bpp = 6; text_layer = tilemap_create( machine, get_text_tile_info, tilemap_scan_rows, 8,8,64,32 ); back_layer = tilemap_create( machine, get_back_tile_info, tilemap_scan_cols, 16,16,32,32 ); mid_layer = tilemap_create( machine, get_mid_tile_info, tilemap_scan_cols, 16,16,32,32 ); @@ -501,6 +501,9 @@ VIDEO_START( spi ) memset(palette_ram, 0, 0x3000); memset(sprite_ram, 0, 0x1000); + sprite_bpp = 6; + sprite_dma_length = 0x1000; + for (i=0; i < 6144; i++) { palette_set_color(machine, i, MAKE_RGB(0, 0, 0)); } @@ -661,12 +664,13 @@ VIDEO_START( sys386f2 ) int i; palette_ram = auto_malloc(0x4000); - sprite_ram = auto_malloc(0x1000); + sprite_ram = auto_malloc(0x2000); + memset(palette_ram, 0, 0x4000); + memset(sprite_ram, 0, 0x2000); sprite_bpp = 8; - - memset(palette_ram, 0, 0x4000); - memset(sprite_ram, 0, 0x1000); + sprite_dma_length = 0x2000; + layer_enable = 0; for (i=0; i < 8192; i++) { palette_set_color(machine, i, MAKE_RGB(0, 0, 0));