trunk/src/mame/video/spbactn.c
| r30584 | r30585 | |
| 171 | 171 | /* mix & blend the tilemaps and sprites into a 32-bit bitmap */ |
| 172 | 172 | blendbitmaps(m_palette, bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, cliprect); |
| 173 | 173 | #else |
| 174 | bitmap.fill(0, cliprect); |
| 174 | 175 | |
| 175 | 176 | 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); |
| 176 | 177 | |
| 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 | |
| 177 | 195 | #endif |
| 178 | 196 | return 0; |
| 179 | 197 | } |
trunk/src/mame/video/tecmo_spr.c
| r30584 | r30585 | |
| 84 | 84 | int 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 ) |
| 85 | 85 | { |
| 86 | 86 | 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 | } |
| 88 | 101 | int count = NUM_SPRITES; |
| 89 | 102 | int drawn = 0; |
| 90 | 103 | int screenwidth = screen.width(); |
| r30584 | r30585 | |
| 97 | 110 | int xposition_word = 4; |
| 98 | 111 | int enable_word = attributes_word; |
| 99 | 112 | |
| 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) |
| 101 | 114 | { |
| 102 | 115 | colour_word = 0; |
| 103 | 116 | attributes_word = 2; |
| r30584 | r30585 | |
| 122 | 135 | UINT32 priority = (attributes >> 6) & 3; |
| 123 | 136 | |
| 124 | 137 | // 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) |
| 126 | 139 | { |
| 127 | 140 | int alt_pri; |
| 128 | 141 | alt_pri = (source[0] & 0x0030)>>4; |
| 129 | 142 | if (alt_pri != pri_hack) |
| 130 | 143 | { |
| 131 | | source -= 8; |
| 144 | source += sourceinc; |
| 132 | 145 | continue; |
| 133 | 146 | } |
| 134 | 147 | } |
| r30584 | r30585 | |
| 253 | 266 | drawn++; |
| 254 | 267 | |
| 255 | 268 | } |
| 256 | | source -= 8; |
| 269 | source += sourceinc; |
| 257 | 270 | } |
| 258 | 271 | |
| 259 | 272 | return drawn; |