Previous 15994 Revisions Next

r5800 Saturday 19th September, 2009 at 15:09:45 UTC by Angelo Salese
[X1]: Rewritten bitmap routine in order to support tile height feature, this fixes gfxs in Xevious and King's Knight
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5799r5800
330330
331331static void draw_gfxbitmap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int w,int plane,int pri)
332332{
333   int xi,yi,x,y;
334   int pen_r,pen_g,pen_b,color;
335   int pri_mask_val;
336
337   for (y=0;y<50;y++)
338   {
339      for(x=0;x<40*w;x++)
340      {
341         for(yi=0;yi<(tile_height+1);yi++)
342         {
343            for(xi=0;xi<8;xi++)
344            {
345               pen_b = (gfx_bitmap_ram[(((x+(y*40*w)+yi*0x800)+crtc_start_addr) & 0x3fff)+0x0000+plane*0xc000]>>(7-xi)) & 1;
346               pen_r = (gfx_bitmap_ram[(((x+(y*40*w)+yi*0x800)+crtc_start_addr) & 0x3fff)+0x4000+plane*0xc000]>>(7-xi)) & 1;
347               pen_g = (gfx_bitmap_ram[(((x+(y*40*w)+yi*0x800)+crtc_start_addr) & 0x3fff)+0x8000+plane*0xc000]>>(7-xi)) & 1;
348
349               color =  pen_g<<2 | pen_r<<1 | pen_b<<0;
350
351               pri_mask_val = priority_mixer_ply(machine,color);
352               if(pri_mask_val & pri) continue;
353
354               if(scrn_reg.v400_mode)
355               {
356                  if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && ((y+yi)*2+0)<=video_screen_get_visible_area(machine->primary_screen)->max_y)
357                     *BITMAP_ADDR16(bitmap, (y+yi)*2+0, x+xi) = machine->pens[color+0x100];
358                  if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && ((y+yi)*2+1)<=video_screen_get_visible_area(machine->primary_screen)->max_y)
359                     *BITMAP_ADDR16(bitmap, (y+yi)*2+1, x+xi) = machine->pens[color+0x100];
360               }
361               else
362               {
363                  if((x+xi)<=video_screen_get_visible_area(machine->primary_screen)->max_x && (y+yi)<=video_screen_get_visible_area(machine->primary_screen)->max_y)
364                     *BITMAP_ADDR16(bitmap, y*(tile_height+1)+yi, x*8+xi) = machine->pens[color+0x100];
365               }
366            }
367         }
368      }
369   }
370}
371
372#if 0
373/* Old code for reference, to be removed soon */
374static void draw_gfxbitmap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int w,int plane,int pri)
375{
333376   int count,xi,yi,x,y;
334377   int pen_r,pen_g,pen_b,color;
335378   int yi_size;
r5799r5800
397440      count&=0x3fff;
398441   }
399442}
443#endif
400444
401445static VIDEO_UPDATE( x1 )
402446{

Previous 15994 Revisions Next


© 1998-2018 The MESS Team