Previous 199869 Revisions Next

r21504 Friday 1st March, 2013 at 02:34:21 UTC by Angelo Salese
Added timer for blitter irq and screen raw params
[src/mame/drivers]gunpey.c

trunk/src/mame/drivers/gunpey.c
r21503r21504
218218   virtual void palette_init();
219219   UINT32 screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
220220   TIMER_DEVICE_CALLBACK_MEMBER(gunpey_scanline);
221   TIMER_CALLBACK_MEMBER(blitter_end);
221222   void gunpey_irq_check(UINT8 irq_type);
222223   UINT16 m_vram_bank;
223224
r21503r21504
249250         x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8);
250251         y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4);
251252
252         x-=0x100;
253         y-=0x100;
253         x-=0x160;
254         y-=0x188;
254255
255256         //UINT32 col = 0xffffff;
256257
r21503r21504
328329                  UINT8 data = vram[((((ysource+yi)&0x7ff)*0x400) + ((xsource+xi)&0x3ff))];
329330
330331                  UINT8 pix;
331                 
332
332333                  pix = (data & 0x0f);
333334
334335                  if(cliprect.contains(x+(xi*2), y+yi))
335336                     bitmap.pix16(y+yi, x+(xi*2)) = pix;
336           
337
337338                  pix = (data & 0xf0)>>4;
338339
339340                  if(cliprect.contains(x+1+(xi*2), y+yi))
r21503r21504
417418   return 0xff;
418419}
419420
421TIMER_CALLBACK_MEMBER(gunpey_state::blitter_end)
422{
423   gunpey_irq_check(4);
424}
425
420426WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
421427{
422428//   UINT16 *blit_buffer = m_blit_buffer;
r21503r21504
451457      ,blit_ram[8],blit_ram[9], dstx
452458      ,blit_ram[0xa],blit_ram[0xb], dsty
453459       ,blit_ram[0xc],
454         
460
455461         blit_ram[0xd],blit_ram[0xe],blit_ram[0xf]);
456462*/
457463      //if (srcx & 0xf800) printf("(error srcx &0xf800)");
458464      //if (srcy & 0xf800) printf("(error srcy &0xf800)");
459465
460466
461      gunpey_irq_check(4);
462
463467      for (int y=0;y<ysize;y++)
464468      {
465469         for (int x=0;x<xsize;x++)
r21503r21504
468472         }
469473      }
470474
471     
475      machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(xsize*ysize), timer_expired_delegate(FUNC(gunpey_state::blitter_end),this));
472476
477
473478/*
474479      printf("%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x\n"
475480      ,blit_ram[0],blit_ram[1],blit_ram[2],blit_ram[3]
r21503r21504
654659   if(scanline == 0)
655660      gunpey_irq_check(0x10);
656661
657   if(scanline == 480)
662   if(scanline == 224)
658663      gunpey_irq_check(0x40);
659664}
660665
r21503r21504
696701   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gunpey_state, gunpey_scanline, "screen", 0, 1)
697702
698703   /* video hardware */
699   /* TODO: screen params */
700704   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 */
705706   MCFG_SCREEN_UPDATE_DRIVER(gunpey_state, screen_update_gunpey)
706707
707708   MCFG_PALETTE_LENGTH(0x800)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team