trunk/src/mame/drivers/coolridr.c
| r21261 | r21262 | |
| 444 | 444 | required_shared_ptr<UINT16> m_soundram2; |
| 445 | 445 | bitmap_rgb32 m_temp_bitmap_sprites; |
| 446 | 446 | bitmap_rgb32 m_temp_bitmap_sprites2; |
| 447 | | UINT32 m_test_offs; |
| 448 | 447 | int m_color; |
| 449 | 448 | UINT8 m_vblank; |
| 450 | 449 | int m_scsp_last_line; |
| r21261 | r21262 | |
| 499 | 498 | { |
| 500 | 499 | machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites); |
| 501 | 500 | machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2); |
| 502 | | m_test_offs = 0x2000; |
| 503 | 501 | } |
| 504 | 502 | |
| 505 | 503 | // might be a page 'map / base' setup somewhere, but it's just used for ingame backgrounds |
| r21261 | r21262 | |
| 513 | 511 | UINT32 count; |
| 514 | 512 | int y,x; |
| 515 | 513 | int color; |
| 516 | | count = m_test_offs/4; |
| 514 | count = 0/4; |
| 517 | 515 | color = m_color; |
| 516 | int scrollx; |
| 517 | int scrolly; |
| 518 | 518 | |
| 519 | 519 | if (which==1) |
| 520 | 520 | { |
| r21261 | r21262 | |
| 529 | 529 | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | scrollx = (m_framebuffer_vram[(0x9bac+which*0x40)/4] >> 16) & 0x7ff; |
| 533 | scrolly = m_framebuffer_vram[(0x9bac+which*0x40)/4] & 0x3ff; |
| 534 | |
| 535 | /* TODO: optimize! */ |
| 532 | 536 | for (y=0;y<64;y++) |
| 533 | 537 | { |
| 534 | 538 | for (x=0;x<128;x+=2) |
| 535 | 539 | { |
| 536 | 540 | int tile; |
| 541 | int res_x,res_y; |
| 537 | 542 | |
| 543 | res_x = ((x+0)*16)-scrollx; |
| 544 | res_y = (y*16)-scrolly; |
| 545 | |
| 538 | 546 | tile = (m_h1_vram[count] & 0x0fff0000) >> 16; |
| 539 | | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,(x+0)*16,y*16); |
| 547 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y); |
| 548 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y); |
| 549 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y+1024); |
| 550 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y+1024); |
| 540 | 551 | |
| 552 | res_x = ((x+1)*16)-scrollx; |
| 553 | res_y = (y*16)-scrolly; |
| 554 | |
| 541 | 555 | tile = (m_h1_vram[count] & 0x00000fff) >> 0; |
| 542 | | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,(x+1)*16,y*16); |
| 556 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y); |
| 557 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y); |
| 558 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y+1024); |
| 559 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y+1024); |
| 543 | 560 | |
| 561 | |
| 544 | 562 | count++; |
| 545 | 563 | } |
| 546 | 564 | } |
| r21261 | r21262 | |
| 562 | 580 | UINT32 coolridr_state::screen_update_coolridr1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 563 | 581 | { |
| 564 | 582 | #if 0 |
| 565 | | if(machine().input().code_pressed(KEYCODE_Z)) |
| 566 | | m_test_offs+=4; |
| 567 | | |
| 568 | | if(machine().input().code_pressed(KEYCODE_X)) |
| 569 | | m_test_offs-=4; |
| 570 | | |
| 571 | | if(machine().input().code_pressed(KEYCODE_C)) |
| 572 | | m_test_offs+=0x40; |
| 573 | | |
| 574 | | if(machine().input().code_pressed(KEYCODE_V)) |
| 575 | | m_test_offs-=0x40; |
| 576 | | |
| 577 | | if(machine().input().code_pressed(KEYCODE_B)) |
| 578 | | m_test_offs+=0x400; |
| 579 | | |
| 580 | | if(machine().input().code_pressed(KEYCODE_N)) |
| 581 | | m_test_offs-=0x400; |
| 582 | | |
| 583 | 583 | if(machine().input().code_pressed_once(KEYCODE_A)) |
| 584 | 584 | m_color++; |
| 585 | 585 | |
| 586 | 586 | if(machine().input().code_pressed_once(KEYCODE_S)) |
| 587 | 587 | m_color--; |
| 588 | 588 | |
| 589 | | if(m_test_offs > 0x100000*4) |
| 590 | | m_test_offs = 0; |
| 591 | | |
| 592 | 589 | #endif |
| 593 | 590 | |
| 594 | | // popmessage("%08x %04x",m_test_offs,m_color); |
| 591 | // popmessage("%04x",m_color); |
| 595 | 592 | |
| 596 | 593 | return screen_update_coolridr(screen,bitmap,cliprect,0); |
| 597 | 594 | } |
| r21261 | r21262 | |
| 2159 | 2156 | |
| 2160 | 2157 | for (int i=0;i<(0x800000*8)/2;i++) |
| 2161 | 2158 | { |
| 2162 | | m_expanded_10bit_gfx[i] = get_10bit_data( 0, i); |
| 2159 | m_expanded_10bit_gfx[i] = get_10bit_data( 0, i); |
| 2163 | 2160 | } |
| 2164 | 2161 | |
| 2165 | 2162 | if (0) |
| r21261 | r21262 | |
| 2169 | 2166 | sprintf(filename,"expanded_%s_gfx", machine().system().name); |
| 2170 | 2167 | fp=fopen(filename, "w+b"); |
| 2171 | 2168 | if (fp) |
| 2172 | | { |
| 2169 | { |
| 2173 | 2170 | for (int i=0;i<(0x800000*8);i++) |
| 2174 | 2171 | { |
| 2175 | 2172 | fwrite((UINT8*)m_expanded_10bit_gfx+(i^1), 1, 1, fp); |
| 2176 | 2173 | } |
| 2177 | 2174 | fclose(fp); |
| 2178 | | |
| 2175 | |
| 2179 | 2176 | } |
| 2180 | 2177 | } |
| 2181 | 2178 | |