trunk/src/mame/drivers/coolridr.c
| r21421 | r21422 | |
| 481 | 481 | int m_gfx_index; |
| 482 | 482 | int m_color_bank; |
| 483 | 483 | UINT32 m_rgb_ctrl[2]; |
| 484 | UINT32 m_pen_fill[2]; |
| 484 | 485 | |
| 485 | 486 | osd_work_queue * m_work_queue[2]; // work queue, one per screen |
| 486 | 487 | static void *draw_tile_row_threaded(void *param, int threadid); |
| r21421 | r21422 | |
| 567 | 568 | base_offset = (which * 0x20000)/2; |
| 568 | 569 | m_color_bank = which * 2; |
| 569 | 570 | |
| 570 | | for (int y=0;y<64;y++) |
| 571 | | { |
| 572 | | for (int x=0;x<128;x++) |
| 571 | if(m_pen_fill[which]) |
| 572 | { |
| 573 | int bg_r,bg_g,bg_b; |
| 574 | /* logic here is a bit of a guess. */ |
| 575 | bg_r = (((m_pen_fill[which] >> 16) & 0x7f) << 1) | (((m_pen_fill[which] >> 16) & 0x80) >> 7); |
| 576 | bg_g = (((m_pen_fill[which] >> 8) & 0x7f) << 1) | (((m_pen_fill[which] >> 8) & 0x80) >> 7); |
| 577 | bg_b = (((m_pen_fill[which] >> 0) & 0x7f) << 1) | (((m_pen_fill[which] >> 0) & 0x80) >> 7); |
| 578 | bitmap.fill(MAKE_ARGB(0xff,bg_r,bg_g,bg_b),cliprect); |
| 579 | } |
| 580 | else |
| 581 | { |
| 582 | for (int y=0;y<64;y++) |
| 573 | 583 | { |
| 574 | | int res_x,res_y; |
| 584 | for (int x=0;x<128;x++) |
| 585 | { |
| 586 | int res_x,res_y; |
| 575 | 587 | |
| 576 | | res_x = (x*16)-scrollx; |
| 577 | | res_y = (y*16)-scrolly; |
| 588 | res_x = (x*16)-scrollx; |
| 589 | res_y = (y*16)-scrolly; |
| 578 | 590 | |
| 579 | | tile = (m_h1_vram[x+y*128+base_offset] & 0x0fff); |
| 580 | | color = m_color_bank + ((tile & 0x800) >> 11) * 4; |
| 591 | tile = (m_h1_vram[x+y*128+base_offset] & 0x0fff); |
| 592 | color = m_color_bank + ((tile & 0x800) >> 11) * 4; |
| 581 | 593 | |
| 582 | | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y); |
| 583 | | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y); |
| 584 | | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y+1024); |
| 585 | | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y+1024); |
| 594 | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y); |
| 595 | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y); |
| 596 | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y+1024); |
| 597 | drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y+1024); |
| 598 | } |
| 586 | 599 | } |
| 587 | 600 | } |
| 588 | 601 | |
| r21421 | r21422 | |
| 1913 | 1926 | |
| 1914 | 1927 | case 0x04: /* init - value 0x040c80d2 (unknown purpose, slave mode?) */ |
| 1915 | 1928 | case 0x10: /* sets up look-up for tilemap video registers */ |
| 1916 | | case 0x20: /* unknown table */ |
| 1917 | | case 0x24: /* unknown table */ |
| 1918 | | case 0x30: /* screen 1 - 0x80 at boot, then 0x808080 */ |
| 1919 | | case 0x34: /* screen 2 / */ |
| 1929 | case 0x20: /* screen 1 - linescroll/zoom table? (default values) */ |
| 1930 | case 0x24: /* screen 2 / */ |
| 1920 | 1931 | case 0x50: /* screen 1 - unknown */ |
| 1921 | 1932 | case 0x54: /* screen 2 / */ |
| 1922 | | //printf("%02x %08x\n",cmd,m_framebuffer_vram[(0+dma_index)/4]); |
| 1923 | 1933 | dma_index+=4; |
| 1924 | 1934 | break; |
| 1935 | case 0x30: /* screen 1 - 0x80 at boot, then 0x808080 */ |
| 1936 | case 0x34: /* screen 2 / */ |
| 1937 | m_pen_fill[(cmd & 4) >> 2] = m_framebuffer_vram[(0+dma_index)/4] & 0xffffff; |
| 1938 | dma_index+=4; |
| 1939 | break; |
| 1925 | 1940 | case 0x40: /* screen 1 - almost certainly RGB brightness (at least bits 4 - 0) */ |
| 1926 | 1941 | case 0x44: /* screen 2 / */ |
| 1927 | 1942 | m_rgb_ctrl[(cmd & 4) >> 2] = m_framebuffer_vram[(0+dma_index)/4] & 0xffffff; |