Previous 15994 Revisions Next

r5593 Saturday 5th September, 2009 at 15:37:57 UTC by Angelo Salese
[X1]: Fixed a PLY priority quirk
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5592r5593
257257   }
258258}
259259
260/*
261 * Priority Mixer Calculation (PLY)
262 *
263 * If ply is 0xff then the bitmap entirely covers the tilemap, if it's 0x00 then
264 * the tilemap priority is entirely above the bitmap. Any other value mixes the
265 * bitmap and the tilemap priorities based on the pen value, bit 0 = entry 0 <-> bit 7 = entry 7
266 * of the bitmap.
267 *
268 */
269static int priority_mixer_ply(running_machine *machine,int color)
270{
271   int pri_i,pri_mask_calc;
272
273   pri_i = 0;
274   pri_mask_calc = 1;
275
276   while(pri_i < 7)
277   {
278      if((color & 7) == pri_i)
279         break;
280
281      pri_i++;
282      pri_mask_calc<<=1;
283   }
284
285   return pri_mask_calc;
286}
287
260288static void draw_gfxbitmap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int w,int plane,int pri)
261289{
262290   int count,xi,yi,x,y;
263291   int pen_r,pen_g,pen_b,color;
264292   int yi_size;
265   int pri_i,pri_mask_val,pri_helper;
293   int pri_mask_val;
266294
267295   count = crtc_start_addr;
268296
r5592r5593
282310
283311               color =  pen_g<<2 | pen_r<<1 | pen_b<<0;
284312
285               /* Priority mixer calculation (PLY) */
286               {
287                  pri_i = 0;
288                  pri_mask_val = 1;
289                  pri_helper = 0;
290
291                  while(pri_i < 7 && pri_helper == 0)
292                  {
293                     if((color & 7) == pri_i)
294                        pri_helper = 1;
295                     else
296                     {
297                        pri_i++;
298                        pri_mask_val<<=1;
299                     }
300                  }
301               }
302
313               pri_mask_val = priority_mixer_ply(machine,color);
303314               if(pri_mask_val & pri) continue;
304315
305               if(color == 0)
306                  continue;
307
308316               if(w == 1)
309317               {
310318                  if(yi & 1)
r5592r5593
332340
333341   w = (video_screen_get_width(screen) < 640) ? 1 : 2;
334342
335   bitmap_fill(bitmap, cliprect, screen->machine->pens[0x100]);
336
337343   draw_gfxbitmap(screen->machine,bitmap,cliprect,w,0,scrn_reg.ply);
338344   draw_fgtilemap(screen->machine,bitmap,cliprect,w);
339345   draw_gfxbitmap(screen->machine,bitmap,cliprect,w,0,scrn_reg.ply^0xff);
340   /* Y's uses the following as a normal buffer without anything reasonable to draw */
346   /* Y's uses the following as a normal buffer/work ram without anything reasonable to draw */
341347//   draw_gfxbitmap(screen->machine,bitmap,cliprect,w,1);
342348
343349   return 0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team