Previous 15994 Revisions Next

r8982 Tuesday 31st August, 2010 at 21:28:45 UTC by Angelo Salese
[MZ-2500]: Implemented CG mode 0x03, used by Yukar K2
[src/mess/drivers]mz2500.c

src/mess/drivers/mz2500.c
r8981r8982
314314   }
315315}
316316
317static void draw_cg4_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
318{
319   static UINT32 count;
320   UINT8 *vram = memory_region(machine, "maincpu");
321   UINT8 pen,pen_bit[2];
322   int x,y,xi,pen_i;
323   int res_x,res_y;
324
325   count = 0x40000;
326
327   for(y=0;y<400;y++)
328   {
329      for(x=0;x<640;x+=8)
330      {
331         for(xi=0;xi<8;xi++)
332         {
333            res_x = x+xi;
334            res_y = y;
335
336            /* check window boundaries */
337            //if(res_x < cg_hs || res_x >= cg_he || res_y < cg_vs || res_y >= cg_ve)
338            //   continue;
339
340            /* TODO: very preliminary, just Yukar K2 uses this so far*/
341            pen_bit[0] = (vram[count + 0x00000]>>(xi)) & 1 ? 7 : 0; // B
342            pen_bit[1] = (vram[count + 0x0c000]>>(xi)) & 1 ? 7 : 0; // R
343
344            pen = 0;
345            for(pen_i=0;pen_i<2;pen_i++)
346               pen |= pen_bit[pen_i];
347
348            {
349               //if(pri == ((clut256[pen] & 0x100) >> 8))
350                  *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[pen];
351            }
352         }
353         count++;
354      }
355   }
356}
357
317358static void draw_cg16_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int plane,int x_size,int pri)
318359{
319360   static UINT32 count;
r8981r8982
443484   {
444485      case 0x00:
445486         break;
487      case 0x03:
488         draw_cg4_screen(machine,bitmap,cliprect,0);
489         break;
446490      case 0x14:
447491         draw_cg16_screen(machine,bitmap,cliprect,0,320,pri);
448492         draw_cg16_screen(machine,bitmap,cliprect,1,320,pri);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team