trunk/src/mame/drivers/coolridr.c
| r21401 | r21402 | |
| 512 | 512 | { |
| 513 | 513 | /* planes seems to basically be at 0x8000 and 0x28000... */ |
| 514 | 514 | gfx_element *gfx = machine().gfx[0]; |
| 515 | | UINT32 count; |
| 515 | UINT32 base_offset; |
| 516 | UINT32 tile_offset; |
| 516 | 517 | int y,x; |
| 517 | 518 | int color; |
| 518 | 519 | int scrollx; |
| 519 | 520 | int scrolly; |
| 520 | 521 | |
| 521 | | count = 0; |
| 522 | | m_color = 0; |
| 523 | | |
| 524 | | if (which==1) |
| 525 | | { |
| 526 | | count += 0x20000; |
| 527 | | // color += 0x5e; |
| 528 | | m_color = 2; |
| 529 | | } |
| 530 | | else |
| 531 | | { |
| 532 | | // color += 0x4e; |
| 533 | | // color += 0x0; |
| 534 | | } |
| 535 | | |
| 536 | 522 | scrollx = (m_framebuffer_vram[(0x9bac+which*0x40)/4] >> 16) & 0x7ff; |
| 537 | 523 | scrolly = m_framebuffer_vram[(0x9bac+which*0x40)/4] & 0x3ff; |
| 538 | 524 | |
| 539 | | /* TODO: optimize! */ |
| 525 | base_offset = which * 0x20000; |
| 526 | m_color = which * 2; |
| 527 | |
| 540 | 528 | for (y=0;y<64;y++) |
| 541 | 529 | { |
| 542 | 530 | for (x=0;x<128;x++) |
| 543 | 531 | { |
| 544 | 532 | int tile; |
| 545 | 533 | int res_x,res_y; |
| 546 | | UINT16 cur_ptr; |
| 534 | UINT16 cur_tile; |
| 547 | 535 | |
| 548 | 536 | res_x = (x*16)-scrollx; |
| 549 | 537 | res_y = (y*16)-scrolly; |
| 538 | tile_offset = (x+y*128)*2; |
| 539 | tile_offset+= base_offset; |
| 550 | 540 | |
| 551 | | cur_ptr = (m_h1_vram[count]<<8)|m_h1_vram[count+1]; |
| 541 | cur_tile = (m_h1_vram[tile_offset]<<8)|m_h1_vram[tile_offset+1]; |
| 552 | 542 | |
| 553 | | tile = cur_ptr & 0x07ff; |
| 554 | | color = m_color + ((cur_ptr & 0x0800) >> 11) * 4; |
| 543 | tile = cur_tile & 0x07ff; |
| 544 | color = m_color + ((cur_tile & 0x0800) >> 11) * 4; |
| 555 | 545 | |
| 556 | 546 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y); |
| 557 | 547 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y); |
| 558 | 548 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y+1024); |
| 559 | 549 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y+1024); |
| 560 | | |
| 561 | | count+=2; |
| 562 | 550 | } |
| 563 | 551 | } |
| 564 | 552 | |