trunk/src/mame/video/deco_mlc.c
| r21878 | r21879 | |
| 80 | 80 | myclip = clip; |
| 81 | 81 | myclip &= dest_bmp.cliprect(); |
| 82 | 82 | |
| 83 | | |
| 83 | if( usey < myclip.min_y ) |
| 84 | return; |
| 85 | |
| 86 | if( usey > myclip.max_y+1 ) |
| 87 | return; |
| 88 | |
| 84 | 89 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; |
| 85 | 90 | const UINT8 *code_base1 = gfx->get_data(code1 % gfx->elements()); |
| 86 | 91 | const UINT8 *code_base2 = gfx->get_data(code2 % gfx->elements()); |
| r21878 | r21879 | |
| 88 | 93 | int sprite_screen_width = (scalex*16+(sx&0xffff))>>16; |
| 89 | 94 | |
| 90 | 95 | sx>>=16; |
| 91 | | int sy = usey; |
| 92 | 96 | if (sprite_screen_width) |
| 93 | 97 | { |
| 94 | 98 | /* compute sprite increment per screen pixel */ |
| r21878 | r21879 | |
| 125 | 129 | |
| 126 | 130 | if( ex>sx ) |
| 127 | 131 | { /* skip if inner loop doesn't draw anything */ |
| 128 | | int y; |
| 129 | 132 | |
| 130 | | /* case 1: no alpha */ |
| 133 | /* no alpha */ |
| 131 | 134 | if (alpha == 0xff) |
| 132 | 135 | { |
| 133 | | y = sy; |
| 136 | const UINT8 *source1 = code_base1 + (srcline) * gfx->rowbytes(); |
| 137 | const UINT8 *source2 = code_base2 + (srcline) * gfx->rowbytes(); |
| 138 | UINT32 *dest = &dest_bmp.pix32(usey); |
| 134 | 139 | |
| 135 | | if( y < myclip.min_y ) |
| 136 | | return; |
| 140 | int x, x_index = x_index_base; |
| 137 | 141 | |
| 138 | | if( y > myclip.max_y+1 ) |
| 139 | | return; |
| 140 | | |
| 141 | | |
| 142 | | |
| 142 | for( x=sx; x<ex; x++ ) |
| 143 | 143 | { |
| 144 | | const UINT8 *source1 = code_base1 + (srcline) * gfx->rowbytes(); |
| 145 | | const UINT8 *source2 = code_base2 + (srcline) * gfx->rowbytes(); |
| 146 | | UINT32 *dest = &dest_bmp.pix32(y); |
| 144 | int c = source1[x_index>>16]; |
| 145 | if (use8bpp) |
| 146 | c=(c<<4)|source2[x_index>>16]; |
| 147 | 147 | |
| 148 | | int x, x_index = x_index_base; |
| 148 | if( c != transparent_color ) dest[x] = pal[c]; |
| 149 | 149 | |
| 150 | | for( x=sx; x<ex; x++ ) |
| 151 | | { |
| 152 | | int c = source1[x_index>>16]; |
| 153 | | if (use8bpp) |
| 154 | | c=(c<<4)|source2[x_index>>16]; |
| 155 | | |
| 156 | | if( c != transparent_color ) dest[x] = pal[c]; |
| 157 | | |
| 158 | | x_index += dx; |
| 159 | | } |
| 160 | | } |
| 150 | x_index += dx; |
| 151 | } |
| 161 | 152 | } |
| 162 | | |
| 163 | | /* case 6: alpha blended */ |
| 164 | 153 | else |
| 165 | 154 | { |
| 166 | | y = sy; |
| 155 | const UINT8 *source = code_base1 + (srcline) * gfx->rowbytes(); |
| 156 | UINT32 *dest = &dest_bmp.pix32(usey); |
| 167 | 157 | |
| 168 | | if( y < myclip.min_y ) |
| 169 | | return; |
| 170 | | |
| 171 | | if( y > myclip.max_y+1 ) |
| 172 | | return; |
| 173 | | |
| 158 | int x, x_index = x_index_base; |
| 159 | for( x=sx; x<ex; x++ ) |
| 174 | 160 | { |
| 175 | | const UINT8 *source = code_base1 + (srcline) * gfx->rowbytes(); |
| 176 | | UINT32 *dest = &dest_bmp.pix32(y); |
| 177 | | |
| 178 | | int x, x_index = x_index_base; |
| 179 | | for( x=sx; x<ex; x++ ) |
| 180 | | { |
| 181 | | int c = source[x_index>>16]; |
| 182 | | if( c != transparent_color ) dest[x] = alpha_blend_r32(dest[x], 0, alpha); //pal[c]); |
| 183 | | x_index += dx; |
| 184 | | } |
| 185 | | |
| 186 | | |
| 161 | int c = source[x_index>>16]; |
| 162 | if( c != transparent_color ) dest[x] = alpha_blend_r32(dest[x], 0, alpha); //pal[c]); |
| 163 | x_index += dx; |
| 187 | 164 | } |
| 188 | | |
| 189 | 165 | } |
| 190 | 166 | } |
| 191 | 167 | } |
| r21878 | r21879 | |
| 404 | 380 | int dy = (16<<16)/sprite_screen_height; |
| 405 | 381 | |
| 406 | 382 | |
| 407 | | |
| 383 | |
| 408 | 384 | int counter = 0; |
| 409 | 385 | for (int y=realybase;y<ey;y++) |
| 410 | 386 | { |