trunk/src/mame/includes/stv.h
| r20831 | r20832 | |
| 387 | 387 | |
| 388 | 388 | void stv_vdp2_draw_basic_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 389 | 389 | void stv_vdp2_draw_basic_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 390 | | // void draw_rgb16_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 390 | void draw_rgb15_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 391 | 391 | void draw_rgb32_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 392 | 392 | |
| 393 | 393 | void stv_vdp2_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,int transparency,int transparent_color,int scalex, int scaley,int sprite_screen_width, int sprite_screen_height, int alpha); |
trunk/src/mame/video/stvvdp2.c
| r20831 | r20832 | |
| 2999 | 2999 | |
| 3000 | 3000 | } |
| 3001 | 3001 | |
| 3002 | | #define BITMAP_RGB32 4 |
| 3003 | 3002 | |
| 3003 | void saturn_state::draw_rgb15_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 3004 | { |
| 3005 | int xsize, ysize; |
| 3006 | int xsrc,ysrc,xdst,ydst; |
| 3007 | int src_offs; |
| 3008 | UINT8* vram = m_vdp2.gfx_decode; |
| 3009 | UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000; |
| 3010 | int scrollx = stv2_current_tilemap.scrollx; |
| 3011 | int scrolly = stv2_current_tilemap.scrolly; |
| 3012 | int r,g,b; |
| 3013 | UINT16 dot_data; |
| 3004 | 3014 | |
| 3005 | | #if 0 |
| 3006 | | void saturn_state::draw_rgb16_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 3007 | | { |
| 3008 | | // ... |
| 3015 | /* TODO: clean this up. */ |
| 3016 | xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; |
| 3017 | ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; |
| 3018 | |
| 3019 | for(ydst=cliprect.min_y;ydst<=cliprect.max_y;ydst++) |
| 3020 | { |
| 3021 | for(xdst=cliprect.min_x;xdst<=cliprect.max_x;xdst++) |
| 3022 | { |
| 3023 | if(stv_vdp2_window_process(xdst,ydst)) |
| 3024 | continue; |
| 3025 | |
| 3026 | xsrc = (xdst + scrollx) & (xsize-1); |
| 3027 | ysrc = (ydst + scrolly) & (ysize-1); |
| 3028 | src_offs = (xsrc + (ysrc*xsize)); |
| 3029 | src_offs *= 2; |
| 3030 | src_offs += map_offset; |
| 3031 | src_offs &= 0x7ffff; |
| 3032 | |
| 3033 | dot_data =(vram[src_offs]<<8)|(vram[src_offs+1]<<0); |
| 3034 | |
| 3035 | if ((dot_data & 0x8000) || (stv2_current_tilemap.transparency == STV_TRANSPARENCY_NONE)) |
| 3036 | { |
| 3037 | b = pal5bit((dot_data & 0x7c00) >> 10); |
| 3038 | g = pal5bit((dot_data & 0x03e0) >> 5); |
| 3039 | r = pal5bit((dot_data & 0x001f) >> 0); |
| 3040 | |
| 3041 | if(stv2_current_tilemap.fade_control & 1) |
| 3042 | stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2); |
| 3043 | |
| 3044 | if ( stv2_current_tilemap.colour_calculation_enabled == 0 ) |
| 3045 | bitmap.pix32(ydst, xdst) = MAKE_RGB(r, g, b); |
| 3046 | else |
| 3047 | bitmap.pix32(ydst, xdst) = alpha_blend_r32( bitmap.pix32(ydst, xdst), MAKE_RGB(r, g, b), stv2_current_tilemap.alpha ); |
| 3048 | } |
| 3049 | } |
| 3050 | } |
| 3009 | 3051 | } |
| 3010 | | #endif |
| 3011 | 3052 | |
| 3012 | 3053 | void saturn_state::draw_rgb32_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 3013 | 3054 | { |
| r20831 | r20832 | |
| 3025 | 3066 | xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; |
| 3026 | 3067 | ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; |
| 3027 | 3068 | |
| 3028 | | for(ydst=cliprect.min_y;ydst<cliprect.max_y;ydst++) |
| 3069 | for(ydst=cliprect.min_y;ydst<=cliprect.max_y;ydst++) |
| 3029 | 3070 | { |
| 3030 | | for(xdst=cliprect.min_x;xdst<cliprect.max_x;xdst++) |
| 3071 | for(xdst=cliprect.min_x;xdst<=cliprect.max_x;xdst++) |
| 3031 | 3072 | { |
| 3032 | 3073 | if(stv_vdp2_window_process(xdst,ydst)) |
| 3033 | 3074 | continue; |
| 3034 | 3075 | |
| 3035 | 3076 | xsrc = (xdst + scrollx) & (xsize-1); |
| 3036 | 3077 | ysrc = (ydst + scrolly) & (ysize-1); |
| 3037 | | src_offs = ((xsrc + (ysrc*xsize)) + map_offset) & 0x1ffff; |
| 3078 | src_offs = (xsrc + (ysrc*xsize)); |
| 3079 | src_offs *= 4; |
| 3080 | src_offs += map_offset; |
| 3081 | src_offs &= 0x7ffff; |
| 3038 | 3082 | |
| 3039 | | dot_data = (vram[4*src_offs+0]<<24)|(vram[4*src_offs+1]<<16)|(vram[4*src_offs+2]<<8)|(vram[4*src_offs+3]<<0); |
| 3083 | dot_data = (vram[src_offs+0]<<24)|(vram[src_offs+1]<<16)|(vram[src_offs+2]<<8)|(vram[src_offs+3]<<0); |
| 3040 | 3084 | |
| 3041 | 3085 | if ((dot_data & 0x80000000) || (stv2_current_tilemap.transparency == STV_TRANSPARENCY_NONE)) |
| 3042 | 3086 | { |
| r20831 | r20832 | |
| 3080 | 3124 | { |
| 3081 | 3125 | switch(stv2_current_tilemap.colour_depth) |
| 3082 | 3126 | { |
| 3083 | | case BITMAP_RGB32: draw_rgb32_bitmap(bitmap,cliprect); return; |
| 3127 | case 3: draw_rgb15_bitmap(bitmap,cliprect); return; |
| 3128 | case 4: draw_rgb32_bitmap(bitmap,cliprect); return; |
| 3084 | 3129 | } |
| 3085 | 3130 | |
| 3086 | 3131 | /* intentional fall-through*/ |