Previous 199869 Revisions Next

r17805 Tuesday 11th September, 2012 at 23:32:50 UTC by Angelo Salese
Wrap-around fix from Haze for ZT, nw
[src/mame/drivers]raiden2.c
[src/mame/machine]seicop.c

trunk/src/mame/machine/seicop.c
r17804r17805
25022502            //if(dma_trigger != 0x87)
25032503            //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);
25042504
2505            src = (cop_dma_src[cop_dma_trigger] << 6) ;
2505            src = (cop_dma_src[cop_dma_trigger] << 6);
25062506            dst = (cop_dma_dst[cop_dma_trigger] << 6);
25072507            size = ((cop_dma_size[cop_dma_trigger] << 5) - (cop_dma_dst[cop_dma_trigger] << 6) + 0x20)/2;
25082508
trunk/src/mame/drivers/raiden2.c
r17804r17805
680680      int xflip, yflip;
681681      int xstep, ystep;
682682
683      if (sx & 0x8000) sx -= 0x10000;
684      if (sy & 0x8000) sy -= 0x10000;
685683
686
687684      ytlim = (source[0] >> 12) & 0x7;
688685      xtlim = (source[0] >> 8) & 0x7;
689686
r17804r17805
714711      {
715712         for (ytiles = 0; ytiles < ytlim; ytiles++)
716713         {
714            /* note this wraparound handling could be wrong if some of the COP maths is wrong */
715
716#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
717#define ZEROTEAM_MASK_Y (0x1ff)
718
719
717720            drawgfx_transpen(
718721                  bitmap,
719722                  cliprect,
r17804r17805
721724                  tile_number,
722725                  colr,
723726                  yflip,xflip,
724                  sx+xstep*xtiles,sy+ystep*ytiles,15);
727                  (sx+xstep*xtiles)&ZEROTEAM_MASK_X,(sy+ystep*ytiles)&ZEROTEAM_MASK_Y,15);
725728
729            drawgfx_transpen(
730                  bitmap,
731                  cliprect,
732                  gfx,
733                  tile_number,
734                  colr,
735                  yflip,xflip,
736                  ((sx+xstep*xtiles)&ZEROTEAM_MASK_X)-0x200,(sy+ystep*ytiles)&ZEROTEAM_MASK_Y,15);
737
738            drawgfx_transpen(
739                  bitmap,
740                  cliprect,
741                  gfx,
742                  tile_number,
743                  colr,
744                  yflip,xflip,
745                  (sx+xstep*xtiles)&ZEROTEAM_MASK_X,((sy+ystep*ytiles)&ZEROTEAM_MASK_Y)-0x200,15);
746
747            drawgfx_transpen(
748                  bitmap,
749                  cliprect,
750                  gfx,
751                  tile_number,
752                  colr,
753                  yflip,xflip,
754                  ((sx+xstep*xtiles)&ZEROTEAM_MASK_X)-0x200,((sy+ystep*ytiles)&ZEROTEAM_MASK_Y)-0x200,15);
755
756
726757            tile_number++;
727758         }
728759      }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team