Previous 199869 Revisions Next

r21528 Friday 1st March, 2013 at 18:15:08 UTC by David Haywood
commenting out some debug code
[src/mame/drivers]gunpey.c

trunk/src/mame/drivers/gunpey.c
r21527r21528
234234{
235235   int x,y;
236236   int bpp_sel;
237   int height;
238   int width;
239237   int color;
240238   UINT8 *vram = memregion("vram")->base();
241239
r21527r21528
268266   {
269267      x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8);
270268      y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4);
271      height = (m_wram[count+5] >> 8);
272      width = (m_wram[count+5] & 0xff);
269      UINT8 zoomheight = (m_wram[count+5] >> 8);
270      UINT8 zoomwidth = (m_wram[count+5] & 0xff);
273271      bpp_sel = (m_wram[count+0] & 0x18);
274272      color = (m_wram[count+0] >> 8);
275273
276274      x-=0x160;
277275      y-=0x188;
278276
279      UINT8 zoomwidth  = (m_wram[count+6] & 0xff);
280      UINT8 zoomheight = (m_wram[count+7] >> 8);
277      UINT8 sourcewidth  = (m_wram[count+6] & 0xff);
278      UINT8 sourceheight = (m_wram[count+7] >> 8);
281279
282280      //UINT32 col = 0xffffff;
283281   //      UINT32 val = (m_wram[count+1] << 16) | ((m_wram[count+2]));
r21527r21528
290288   //   xsource<<=1;
291289   //   ysource <<=2;
292290
293      UINT8 testhack = vram[((((ysource+0)&0x7ff)*0x800) + ((xsource+0)&0x7ff))];
294      UINT8 testhack2 = vram[((((ysource+0)&0x7ff)*0x800) + ((xsource+1)&0x7ff))];
291//      UINT8 testhack = vram[((((ysource+0)&0x7ff)*0x800) + ((xsource+0)&0x7ff))];
292//      UINT8 testhack2 = vram[((((ysource+0)&0x7ff)*0x800) + ((xsource+1)&0x7ff))];
295293
296      if (m_wram[count+1] & 0x0010)
297         color =  machine.rand()&0xf;
294      //if (m_wram[count+1] & 0x0010)
295      //   color =  machine.rand()&0xf;
298296
299297
300298
r21527r21528
311309      unused = m_wram[count+6]&~0x00ff; if (unused) printf("unused bits set in word 6 - %04x\n", unused);
312310      unused = m_wram[count+7]&~0xff00; if (unused) printf("unused bits set in word 7 - %04x\n", unused);
313311   
314      if ((zoomwidth != width) || (zoomheight!= height))
312      if ((zoomwidth != sourcewidth) || (zoomheight!= zoomheight))
315313      {
316         printf("zoomed widths %02x %02x heights %02x %02x\n", width, zoomwidth, height, zoomheight);
314         //printf("zoomed widths %02x %02x heights %02x %02x\n", sourcewidth, zoomwidth, sourceheight, zoomheight);
317315      }
318316
319317
320318
321      if ((testhack2 & 0x0f) == 0x08)
322         return m_wram[count+0] & 0x80;
319//      if ((testhack2 & 0x0f) == 0x08)
320//         return m_wram[count+0] & 0x80;
323321
324      if (debug) printf("testhack1 %02x %02x\n", testhack, testhack2);
322      //if (debug) printf("testhack1 %02x %02x\n", testhack, testhack2);
325323
326324      if(bpp_sel == 0x00)  // 4bpp
327325      {
328         for(int yi=0;yi<height;yi++)
326         for(int yi=0;yi<sourceheight;yi++)
329327         {
330            for(int xi=0;xi<width/2;xi++)
328            for(int xi=0;xi<sourcewidth/2;xi++)
331329            {
332330               UINT8 data = vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
333331               UINT8 pix;
334332               UINT32 col_offs;
335333               UINT16 color_data;
336334
337         
338
339335               pix = (data & 0x0f);
340336               col_offs = ((pix + color*0x10) & 0xff) << 1;
341337               col_offs+= ((pix + color*0x10) >> 8)*0x800;
342338               color_data = (vram[col_offs])|(vram[col_offs+1]<<8);
343339
344340               if(!(color_data & 0x8000))
345               if(cliprect.contains(x+(xi*2), y+yi))
346                  bitmap.pix16(y+yi, x+(xi*2)) = color_data & 0x7fff;
341                  if(cliprect.contains(x+(xi*2), y+yi))
342                     bitmap.pix16(y+yi, x+(xi*2)) = color_data & 0x7fff;
347343
348344               pix = (data & 0xf0)>>4;
349345               col_offs = ((pix + color*0x10) & 0xff) << 1;
r21527r21528
358354      }
359355      else if(bpp_sel == 0x08) // 6bpp
360356      {
357         printf("6bpp\n");
361358         #if 0
362         for(int yi=0;yi<height;yi++)
359         for(int yi=0;yi<sourceheight;yi++)
363360         {
364            for(int xi=0;xi<width;xi++)
361            for(int xi=0;xi<sourcewidth;xi++)
365362            {
366363               UINT8 data = vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
367364               UINT8 pix;
r21527r21528
377374      }
378375      else if(bpp_sel == 0x10) // 8bpp
379376      {
380         for(int yi=0;yi<height;yi++)
377         for(int yi=0;yi<sourceheight;yi++)
381378         {
382            for(int xi=0;xi<width;xi++)
379            for(int xi=0;xi<sourcewidth;xi++)
383380            {
384381               UINT8 data = vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
385382               UINT8 pix;
r21527r21528
399396      }
400397      else if(bpp_sel == 0x18) // RGB32k
401398      {
399         printf("32k\n");
402400         // ...
403401      }
404402   }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team