From 355103d609988024e1c3574658de9a5209ae7009 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Thu, 24 Jan 2013 00:27:48 +0000 Subject: [PATCH] SCSP: Made MSLC register to be write only, fixes Deka Yonku ~Tough the Truck~ hang on Human logo --- src/emu/sound/scsp.c | 8 +++++++- src/mame/video/stvvdp2.c | 25 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index ff583851218..04aaf430ba7 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -736,6 +736,11 @@ static void SCSP_UpdateReg(scsp_state *scsp, address_space &space, int reg) case 0x7: scsp_midi_in(space.machine().device("scsp"), space, 0, scsp->udata.data[0x6/2]&0xff, 0); break; + case 8: + case 9: + /* Only MSLC could be written. */ + scsp->udata.data[0x8/2] &= 0x7800; + break; case 0x12: case 0x13: case 0x14: @@ -901,7 +906,8 @@ static void SCSP_UpdateRegR(scsp_state *scsp, address_space &space, int reg) unsigned int SGC = (slot->EG.state) & 3; unsigned int CA = (slot->cur_addr>>(SHIFT+12)) & 0xf; unsigned int EG = (0x1f - (slot->EG.volume>>(EG_SHIFT+5))) & 0x1f; - scsp->udata.data[0x8/2] = (MSLC << 11) | (CA << 7) | (SGC << 5) | EG; + /* note: according to the manual MSLC is write only, CA, SGC and EG read only. */ + scsp->udata.data[0x8/2] = /*(MSLC << 11) |*/ (CA << 7) | (SGC << 5) | EG; } break; diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c index d3aa9fba1ab..7a8c32b8a37 100644 --- a/src/mame/video/stvvdp2.c +++ b/src/mame/video/stvvdp2.c @@ -3927,14 +3927,14 @@ static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bit int i; int scroll_values_equal; int lines; - INT16 scrollx, scrolly; + INT16 main_scrollx, main_scrolly; // INT32 incx; int linescroll_enable, vertical_linescroll_enable, linezoom_enable; int vertical_linescroll_index = -1; // read original scroll values - scrollx = stv2_current_tilemap.scrollx; - scrolly = stv2_current_tilemap.scrolly; + main_scrollx = stv2_current_tilemap.scrollx; + main_scrolly = stv2_current_tilemap.scrolly; // incx = stv2_current_tilemap.incx; // prepare linescroll flags @@ -4019,13 +4019,13 @@ static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bit { prev_scroll_values[i] &= 0x07ffff00; if ( prev_scroll_values[i] & 0x04000000 ) prev_scroll_values[i] |= 0xf8000000; - stv2_current_tilemap.scrollx = scrollx + (prev_scroll_values[i] >> 16); + stv2_current_tilemap.scrollx = main_scrollx + (prev_scroll_values[i] >> 16); i++; } // vertical line scroll if ( vertical_linescroll_enable ) { - stv2_current_tilemap.scrolly = scrolly + (prev_scroll_values[i] >> 16); + stv2_current_tilemap.scrolly = main_scrolly + (prev_scroll_values[i] >> 16); i++; } @@ -4040,7 +4040,20 @@ static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bit // if ( LOG_VDP2 ) logerror( "Linescroll: y < %d, %d >, scrollx = %d, scrolly = %d, incx = %f\n", mycliprect.min_y, mycliprect.max_y, stv2_current_tilemap.scrollx, stv2_current_tilemap.scrolly, (float)stv2_current_tilemap.incx/65536.0 ); // render current tilemap portion - stv_vdp2_check_tilemap(machine, bitmap, mycliprect ); + stv_vdp2_apply_window_on_layer(machine,mycliprect); + + if (stv2_current_tilemap.bitmap_enable) // this layer is a bitmap + { + /*elandore doesn't like current cliprect code,will be worked on...*/ + //if ( window_applied && stv2_current_tilemap.colour_depth != 4) + // stv2_current_tilemap.window_control = 0; + + stv_vdp2_draw_basic_bitmap(machine, bitmap, mycliprect); + } + else + { + stv_vdp2_draw_basic_tilemap(machine, bitmap, mycliprect); + } // update parameters for next iteration memcpy( prev_scroll_values, scroll_values, sizeof(scroll_values));