Previous 199869 Revisions Next

r30585 Wednesday 21st May, 2014 at 14:08:40 UTC by David Haywood
more movement towards better rendering (nw)
[src/mame/video]spbactn.c tecmo_spr.c

trunk/src/mame/video/spbactn.c
r30584r30585
171171   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
172172   blendbitmaps(m_palette, bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, cliprect);
173173#else
174   bitmap.fill(0, cliprect);
174175
175176   m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, m_tile_bitmap_bg, m_tile_bitmap_fg, m_tile_bitmap_fg, cliprect, m_spvideoram, 0, 0, flip_screen(), -2, m_sprite_bitmap);
176177
178
179   int y, x;
180   const pen_t *paldata = m_palette->pens();
181
182   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
183   {
184      UINT32 *dd = &bitmap.pix32(y);
185      UINT16 *sd2 = &m_sprite_bitmap.pix16(y);
186
187      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
188      {
189         UINT16 pixel = (sd2[x] & 0xff) + 0x800;
190
191         if (pixel & 0xf) dd[x] = paldata[pixel];
192      }
193   }
194
177195#endif
178196   return 0;
179197}
trunk/src/mame/video/tecmo_spr.c
r30584r30585
8484int tecmo_spr_device::gaiden_draw_sprites( screen_device &screen, gfxdecode_device *gfxdecode, bitmap_ind16 &bitmap_bg, bitmap_ind16 &bitmap_fg, bitmap_ind16 &bitmap_sp, const rectangle &cliprect, UINT16* spriteram, int sprite_sizey, int spr_offset_y, int flip_screen, int pri_hack, bitmap_ind16 &bitmap_prihack )
8585{
8686   gfx_element *gfx = gfxdecode->gfx(m_gfxregion);
87   const UINT16 *source = (NUM_SPRITES - 1) * 8 + spriteram;
87   UINT16 *source;
88   int sourceinc;
89
90
91   if (pri_hack == -2)
92   {
93      source = spriteram;
94      sourceinc = 8;
95   }
96   else
97   {
98      source = (NUM_SPRITES - 1) * 8 + spriteram;
99      sourceinc = -8;
100   }
88101   int count = NUM_SPRITES;
89102   int drawn = 0;
90103   int screenwidth = screen.width();
r30584r30585
97110   int xposition_word = 4;
98111   int enable_word = attributes_word;
99112
100   if (m_altformat) // spbactn proto, this isn't right.. there are more changes I think
113   if (m_altformat) // spbactn proto, this isn't right..(it's probably just passing the priority / colour bits into the mixer swapped around, so can be handled externally once we output a single bitmap)
101114   {
102115      colour_word = 0;
103116      attributes_word = 2;
r30584r30585
122135         UINT32 priority = (attributes >> 6) & 3;
123136         
124137         // hack for spbactn which still calls us multi-pass (and uses different bits into the mixer as priority?)
125         if (pri_hack != -1)
138         if (pri_hack >= 0)
126139         {
127140            int alt_pri;
128141            alt_pri = (source[0] & 0x0030)>>4;
129142            if (alt_pri != pri_hack)
130143            {
131               source -= 8;
144               source += sourceinc;
132145               continue;
133146            }
134147         }
r30584r30585
253266         drawn++;
254267
255268      }
256      source -= 8;
269      source += sourceinc;
257270   }
258271
259272   return drawn;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team