Previous 199869 Revisions Next

r21508 Friday 1st March, 2013 at 04:21:39 UTC by Angelo Salese
Added height & width
[src/mame/drivers]gunpey.c

trunk/src/mame/drivers/gunpey.c
r21507r21508
236236   //UINT16 *blit_buffer = m_blit_buffer;
237237   int x,y;
238238   int count;
239   int bpp_sel;
240   int height;
241   int width;
239242   UINT16 vram_bank = m_vram_bank & 0x7fff;
240243   UINT8 *vram = memregion("vram")->base();
241244
r21507r21508
243246
244247   vram_bank ^= 0x2000;
245248
246   for(count = vram_bank/2;count<(vram_bank+0x2000)/2;count+=0x10/2)
249   /* last 4 entries are special, skip them for now. */
250   for(count = vram_bank/2;count<(vram_bank+0x2000-0x40)/2;count+=0x10/2)
247251   {
248252      if(!(m_wram[count+0] & 1))
249253      {
250254         x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8);
251255         y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4);
256         width = (m_wram[count+5] >> 8);
257         height = (m_wram[count+5] & 0xff);
258         bpp_sel = (m_wram[count+0] & 0x18);
252259
253260         x-=0x160;
254261         y-=0x188;
r21507r21508
321328            drawgfx_opaque(bitmap,cliprect,machine().gfx[1],letter,1,0,0,x,y);
322329         else
323330#endif
331         if(bpp_sel == 0x00)
324332         {
325            for(int yi=0;yi<8;yi++)
333            for(int yi=0;yi<height;yi++)
326334            {
327               for(int xi=0;xi<4;xi++)
335               for(int xi=0;xi<width/2;xi++)
328336               {
329337                  UINT8 data = vram[((((ysource+yi)&0x7ff)*0x400) + ((xsource+xi)&0x3ff))];
330338
r21507r21508
339347
340348                  if(cliprect.contains(x+1+(xi*2), y+yi))
341349                     bitmap.pix16(y+yi, x+1+(xi*2)) = pix;
342
343
344350               }
345351            }
346352         }
353
347354      }
348355   }
349356
r21507r21508
446453      int ysize = blit_ram[0x0e]+1;
447454//      int color,color_offs;
448455
456      printf("%04x %04x %04x %04x\n",srcx,srcy,dstx,dsty);
457
449458/*
450459     printf("%02x %02x %02x %02x| (X SRC 4: %02x 5: %02x (val %04x))  (Y SRC 6: %02x 7: %02x (val %04x))  | (X DEST 8: %02x 9: %02x (val %04x))  (Y DEST a: %02x b: %02x (val %04x)) |  %02x %02x %02x %02x\n"
451460      ,blit_ram[0],blit_ram[1],blit_ram[2],blit_ram[3]
r21507r21508
468477      {
469478         for (int x=0;x<xsize;x++)
470479         {
471            vram[(((dsty+y)&0x7ff)*0x400)+((dstx+x)&0x3ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)];
480            vram[(((dsty+y)&0x3ff)*0x400)+((dstx+x)&0x3ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)];
472481         }
473482      }
474483

Previous 199869 Revisions Next


© 1997-2024 The MAME Team