summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2012-09-11 23:32:50 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2012-09-11 23:32:50 +0000
commitd901fed61a94d153720748a9d4b432f083c987ef (patch)
tree93f622d0e2aa0367185d3f36d4ffd52c38031d92 /src/mame
parent784717afbf6583bb9b780a489979c7e73fd68b30 (diff)
Wrap-around fix from Haze for ZT, nw
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/raiden2.c39
-rw-r--r--src/mame/machine/seicop.c2
2 files changed, 36 insertions, 5 deletions
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index 02db5f74649..57099efd664 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -680,9 +680,6 @@ void raiden2_state::draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,
int xflip, yflip;
int xstep, ystep;
- if (sx & 0x8000) sx -= 0x10000;
- if (sy & 0x8000) sy -= 0x10000;
-
ytlim = (source[0] >> 12) & 0x7;
xtlim = (source[0] >> 8) & 0x7;
@@ -714,6 +711,12 @@ void raiden2_state::draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,
{
for (ytiles = 0; ytiles < ytlim; ytiles++)
{
+ /* note this wraparound handling could be wrong if some of the COP maths is wrong */
+
+#define ZEROTEAM_MASK_X (0x1ff) // causes a blank square in the corner of zero team, but otherwise the thrusters of the ship in the r2 intro are clipped, using 0x8000 as a sign bit instead of this logic works for r2, but not zero team
+#define ZEROTEAM_MASK_Y (0x1ff)
+
+
drawgfx_transpen(
bitmap,
cliprect,
@@ -721,7 +724,35 @@ void raiden2_state::draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,
tile_number,
colr,
yflip,xflip,
- sx+xstep*xtiles,sy+ystep*ytiles,15);
+ (sx+xstep*xtiles)&ZEROTEAM_MASK_X,(sy+ystep*ytiles)&ZEROTEAM_MASK_Y,15);
+
+ drawgfx_transpen(
+ bitmap,
+ cliprect,
+ gfx,
+ tile_number,
+ colr,
+ yflip,xflip,
+ ((sx+xstep*xtiles)&ZEROTEAM_MASK_X)-0x200,(sy+ystep*ytiles)&ZEROTEAM_MASK_Y,15);
+
+ drawgfx_transpen(
+ bitmap,
+ cliprect,
+ gfx,
+ tile_number,
+ colr,
+ yflip,xflip,
+ (sx+xstep*xtiles)&ZEROTEAM_MASK_X,((sy+ystep*ytiles)&ZEROTEAM_MASK_Y)-0x200,15);
+
+ drawgfx_transpen(
+ bitmap,
+ cliprect,
+ gfx,
+ tile_number,
+ colr,
+ yflip,xflip,
+ ((sx+xstep*xtiles)&ZEROTEAM_MASK_X)-0x200,((sy+ystep*ytiles)&ZEROTEAM_MASK_Y)-0x200,15);
+
tile_number++;
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index 988c5fdcd08..f30caeae71d 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -2502,7 +2502,7 @@ static WRITE16_HANDLER( generic_cop_w )
//if(dma_trigger != 0x87)
//printf("SRC: %08x %08x DST:%08x SIZE:%08x TRIGGER: %08x %02x %02x\n",cop_dma_src[cop_dma_trigger] << 6,cop_dma_fade_table * 0x400,cop_dma_dst[cop_dma_trigger] << 6,cop_dma_size[cop_dma_trigger] << 5,cop_dma_trigger,pal_brightness_val,pal_brightness_mode);
- src = (cop_dma_src[cop_dma_trigger] << 6) ;
+ src = (cop_dma_src[cop_dma_trigger] << 6);
dst = (cop_dma_dst[cop_dma_trigger] << 6);
size = ((cop_dma_size[cop_dma_trigger] << 5) - (cop_dma_dst[cop_dma_trigger] << 6) + 0x20)/2;