From 83972f8cacfa4d83491627704ba4e6d728b79709 Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Wed, 21 May 2014 23:24:05 +0000 Subject: [PATCH] Fix for tharrier text off screen. --- src/burn/drv/pst90s/d_nmk16.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/burn/drv/pst90s/d_nmk16.cpp b/src/burn/drv/pst90s/d_nmk16.cpp index 9671d557e..a0111080c 100644 --- a/src/burn/drv/pst90s/d_nmk16.cpp +++ b/src/burn/drv/pst90s/d_nmk16.cpp @@ -4860,7 +4860,8 @@ static void draw_macross_text_layer(INT32 scrollx, INT32 scrolly, INT32 wide, IN if (nGraphicsMask[0] == 0) return; scrolly = (scrolly + global_y_offset) & 0x1ff; - INT32 wmask = (0x100 << wide) - 1; + scrolly = (scrolly + global_y_offset) & 0x1ff; + INT32 pf_width = (0x100 << wide); UINT16 *vram = (UINT16*)DrvTxRAM; for (INT32 offs = 0; offs < 32 * (32 << wide); offs++) @@ -4868,8 +4869,10 @@ static void draw_macross_text_layer(INT32 scrollx, INT32 scrolly, INT32 wide, IN INT32 sx = (offs >> 5) << 3; INT32 sy = (offs & 0x1f) << 3; - sx = (((sx - scrollx) + 8) & wmask) - 8; - sy = (((sy - scrolly) + 8) & 0xff) - 8; + sx -= scrollx; + if (sx < -7) sx += pf_width; // wrap + sy -= scrolly; + if (sy < -7) sy += 256; // wrap if (sx >= nScreenWidth || sy >= nScreenHeight) continue;