trunk/src/mame/drivers/gunpey.c
| r21503 | r21504 | |
| 218 | 218 | virtual void palette_init(); |
| 219 | 219 | UINT32 screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 220 | 220 | TIMER_DEVICE_CALLBACK_MEMBER(gunpey_scanline); |
| 221 | TIMER_CALLBACK_MEMBER(blitter_end); |
| 221 | 222 | void gunpey_irq_check(UINT8 irq_type); |
| 222 | 223 | UINT16 m_vram_bank; |
| 223 | 224 | |
| r21503 | r21504 | |
| 249 | 250 | x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8); |
| 250 | 251 | y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4); |
| 251 | 252 | |
| 252 | | x-=0x100; |
| 253 | | y-=0x100; |
| 253 | x-=0x160; |
| 254 | y-=0x188; |
| 254 | 255 | |
| 255 | 256 | //UINT32 col = 0xffffff; |
| 256 | 257 | |
| r21503 | r21504 | |
| 328 | 329 | UINT8 data = vram[((((ysource+yi)&0x7ff)*0x400) + ((xsource+xi)&0x3ff))]; |
| 329 | 330 | |
| 330 | 331 | UINT8 pix; |
| 331 | | |
| 332 | |
| 332 | 333 | pix = (data & 0x0f); |
| 333 | 334 | |
| 334 | 335 | if(cliprect.contains(x+(xi*2), y+yi)) |
| 335 | 336 | bitmap.pix16(y+yi, x+(xi*2)) = pix; |
| 336 | | |
| 337 | |
| 337 | 338 | pix = (data & 0xf0)>>4; |
| 338 | 339 | |
| 339 | 340 | if(cliprect.contains(x+1+(xi*2), y+yi)) |
| r21503 | r21504 | |
| 417 | 418 | return 0xff; |
| 418 | 419 | } |
| 419 | 420 | |
| 421 | TIMER_CALLBACK_MEMBER(gunpey_state::blitter_end) |
| 422 | { |
| 423 | gunpey_irq_check(4); |
| 424 | } |
| 425 | |
| 420 | 426 | WRITE8_MEMBER(gunpey_state::gunpey_blitter_w) |
| 421 | 427 | { |
| 422 | 428 | // UINT16 *blit_buffer = m_blit_buffer; |
| r21503 | r21504 | |
| 451 | 457 | ,blit_ram[8],blit_ram[9], dstx |
| 452 | 458 | ,blit_ram[0xa],blit_ram[0xb], dsty |
| 453 | 459 | ,blit_ram[0xc], |
| 454 | | |
| 460 | |
| 455 | 461 | blit_ram[0xd],blit_ram[0xe],blit_ram[0xf]); |
| 456 | 462 | */ |
| 457 | 463 | //if (srcx & 0xf800) printf("(error srcx &0xf800)"); |
| 458 | 464 | //if (srcy & 0xf800) printf("(error srcy &0xf800)"); |
| 459 | 465 | |
| 460 | 466 | |
| 461 | | gunpey_irq_check(4); |
| 462 | | |
| 463 | 467 | for (int y=0;y<ysize;y++) |
| 464 | 468 | { |
| 465 | 469 | for (int x=0;x<xsize;x++) |
| r21503 | r21504 | |
| 468 | 472 | } |
| 469 | 473 | } |
| 470 | 474 | |
| 471 | | |
| 475 | machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(xsize*ysize), timer_expired_delegate(FUNC(gunpey_state::blitter_end),this)); |
| 472 | 476 | |
| 477 | |
| 473 | 478 | /* |
| 474 | 479 | printf("%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x\n" |
| 475 | 480 | ,blit_ram[0],blit_ram[1],blit_ram[2],blit_ram[3] |
| r21503 | r21504 | |
| 654 | 659 | if(scanline == 0) |
| 655 | 660 | gunpey_irq_check(0x10); |
| 656 | 661 | |
| 657 | | if(scanline == 480) |
| 662 | if(scanline == 224) |
| 658 | 663 | gunpey_irq_check(0x40); |
| 659 | 664 | } |
| 660 | 665 | |
| r21503 | r21504 | |
| 696 | 701 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gunpey_state, gunpey_scanline, "screen", 0, 1) |
| 697 | 702 | |
| 698 | 703 | /* video hardware */ |
| 699 | | /* TODO: screen params */ |
| 700 | 704 | MCFG_SCREEN_ADD("screen", RASTER) |
| 701 | | MCFG_SCREEN_REFRESH_RATE(60) |
| 702 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 703 | | MCFG_SCREEN_SIZE(818, 525) |
| 704 | | MCFG_SCREEN_VISIBLE_AREA(0*8, 640-1, 0*8, 480-1) |
| 705 | MCFG_SCREEN_RAW_PARAMS(57242400/8, 442, 0, 320, 264, 0, 224) /* just to get ~60 Hz */ |
| 705 | 706 | MCFG_SCREEN_UPDATE_DRIVER(gunpey_state, screen_update_gunpey) |
| 706 | 707 | |
| 707 | 708 | MCFG_PALETTE_LENGTH(0x800) |