src/mame/video/stvvdp2.c
| r12414 | r12415 | |
| 1403 | 1403 | #define STV_VDP2_BKTA_UL (state->m_vdp2_regs[0x0ac/4]) |
| 1404 | 1404 | |
| 1405 | 1405 | #define STV_VDP2_BKCLMD ((STV_VDP2_BKTA_UL & 0x80000000) >> 31) |
| 1406 | | #define STV_VDP2_BKTA ((STV_VDP2_BKTA_UL & 0x0003ffff) >> 0) |
| 1407 | | /*MSB of this register is used when the extra RAM cart is used,ignore it for now.*/ |
| 1408 | | // #define STV_VDP2_BKTA ((STV_VDP2_BKTA_UL & 0x0007ffff) >> 0) |
| 1406 | #define STV_VDP2_BKTA ((STV_VDP2_BKTA_UL & 0x0007ffff) >> 0) |
| 1409 | 1407 | |
| 1410 | 1408 | /* 1800b0 - RPMD - Rotation Parameter Mode |
| 1411 | 1409 | bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\ |
| r12414 | r12415 | |
| 5270 | 5268 | static void stv_vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 5271 | 5269 | { |
| 5272 | 5270 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 5273 | | int xcnt,ycnt; |
| 5271 | int x,y; |
| 5274 | 5272 | UINT8* gfxdata = state->m_vdp2.gfx_decode; |
| 5275 | | static UINT16 *destline; |
| 5276 | | int r,b,g; |
| 5277 | | UINT16 data; |
| 5273 | UINT32 base_offs,base_mask; |
| 5278 | 5274 | |
| 5279 | | if(!(STV_VDP2_BDCLMD & 1)) |
| 5275 | //popmessage("Back screen %08x %08x %08x",STV_VDP2_BDCLMD,STV_VDP2_BKCLMD,STV_VDP2_BKTA); |
| 5276 | |
| 5277 | /* draw black if BDCLMD and DISP are cleared */ |
| 5278 | if(!(STV_VDP2_BDCLMD) && !(STV_VDP2_DISP)) |
| 5280 | 5279 | bitmap_fill(bitmap, cliprect, get_black_pen(machine)); |
| 5281 | 5280 | else |
| 5282 | 5281 | { |
| 5283 | | #if DEBUG_MODE |
| 5284 | | //popmessage("Back screen enabled %08x",STV_VDP2_BKTA); |
| 5285 | | #endif |
| 5286 | | gfxdata+=((STV_VDP2_BKTA)<<1); |
| 5282 | base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff; |
| 5287 | 5283 | |
| 5288 | | b = ((gfxdata[0] & 0x7c) >> 2); |
| 5289 | | g = ((gfxdata[0] & 0x03) << 3) | ((gfxdata[1] & 0xe0) >> 5); |
| 5290 | | r = ((gfxdata[1] & 0x1f)); |
| 5291 | | data = b | g << 5 | r << 10; |
| 5292 | | |
| 5293 | | for (ycnt = cliprect->min_y; ycnt <= cliprect->max_y;ycnt++) |
| 5284 | for(y=cliprect->min_y;y<=cliprect->max_y;y++) |
| 5294 | 5285 | { |
| 5295 | | destline = BITMAP_ADDR16(bitmap, ycnt, 0); |
| 5286 | base_offs = (STV_VDP2_BKTA & base_mask) << 1; |
| 5287 | if(STV_VDP2_BKCLMD) |
| 5288 | base_offs += (y << 1); |
| 5296 | 5289 | |
| 5297 | | for (xcnt = cliprect->min_x; xcnt <=cliprect->max_x;xcnt++) |
| 5290 | for(x=cliprect->min_x;x<=cliprect->max_x;x++) |
| 5298 | 5291 | { |
| 5299 | | destline[xcnt] = data; |
| 5292 | int r,g,b; |
| 5293 | UINT16 dot; |
| 5294 | |
| 5295 | dot = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1]; |
| 5296 | b = (dot & 0x7c00) >> 10; |
| 5297 | g = (dot & 0x03e0) >> 5; |
| 5298 | r = (dot & 0x001f) >> 0; |
| 5299 | |
| 5300 | *BITMAP_ADDR16(bitmap, y,x) = b | g << 5 | r << 10; |
| 5300 | 5301 | } |
| 5301 | | if(STV_VDP2_BKCLMD) |
| 5302 | | { |
| 5303 | | gfxdata+=2; |
| 5304 | | b = ((gfxdata[0] & 0x7c) >> 2); |
| 5305 | | g = ((gfxdata[0] & 0x03) << 3) | ((gfxdata[1] & 0xe0) >> 5); |
| 5306 | | r = ((gfxdata[1] & 0x1f)); |
| 5307 | | data = b | g << 5 | r << 10; |
| 5308 | | } |
| 5309 | 5302 | } |
| 5310 | 5303 | } |
| 5311 | 5304 | } |