Previous 15994 Revisions Next

r9042 Sunday 5th September, 2010 at 12:55:47 UTC by Angelo Salese
[MZ-2500]: Hooked up clear flag
[src/mess/drivers]mz2500.c

src/mess/drivers/mz2500.c
r9041r9042
9292static UINT16 clut256[0x100];
9393static UINT8 cg_mask;
9494static int scr_x_size,scr_y_size;
95static UINT8 cg_clear_flag;
9596
9697static VIDEO_START( mz2500 )
9798{
r9041r9042
366367   base_mask = (x_size == 640) ? 0x3f : 0x1f;
367368
368369   count = (cg_reg[0x10]) | ((cg_reg[0x11] & base_mask) << 8);
370   count|= (plane & 2) ? 0x10000 : 0x00000;
369371   wa_reg = (cg_reg[0x12]) | ((cg_reg[0x13] & base_mask) << 8);
372   wa_reg|= (plane & 2) ? 0x10000 : 0x00000;
370373   /* TODO: layer 2 scrolling */
371374   s_x = (cg_reg[0x0f] & 0xf);
372375   cg_interlace = text_font_reg ? 1 : 2;
r9041r9042
387390            if(res_x < cg_hs || res_x >= cg_he || res_y < cg_vs || res_y >= cg_ve)
388391               continue;
389392
390            pen_bit[0] = (vram[count+0x40000+(plane * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x01) : 0; //B
391            pen_bit[1] = (vram[count+0x44000+(plane * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x02) : 0; //R
392            pen_bit[2] = (vram[count+0x48000+(plane * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x04) : 0; //G
393            pen_bit[3] = (vram[count+0x4c000+(plane * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x08) : 0; //I
393            pen_bit[0] = (vram[count+0x40000+((plane & 1) * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x01) : 0; //B
394            pen_bit[1] = (vram[count+0x44000+((plane & 1) * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x02) : 0; //R
395            pen_bit[2] = (vram[count+0x48000+((plane & 1) * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x04) : 0; //G
396            pen_bit[3] = (vram[count+0x4c000+((plane & 1) * 0x2000)]>>(xi)) & 1 ? (pen_mask & 0x08) : 0; //I
394397
395398            pen = 0;
396399            for(pen_i=0;pen_i<4;pen_i++)
r9041r9042
513516      case 0x1d:
514517         draw_cg256_screen(machine,bitmap,cliprect,pri);
515518         break;
519      case 0x97:
520         draw_cg16_screen(machine,bitmap,cliprect,2,640,pri);
521         break;
516522      default:
517523         popmessage("Unsupported CG mode %02x, contact MESS dev",cg_reg[0x0e]);
518524         break;
r9041r9042
11591165   {
11601166      static UINT8 vblank_bit;
11611167
1162      // ---- ---x clear flag
1163      vblank_bit = space->machine->primary_screen->vblank() ? 0 : 0x80;
1168      vblank_bit = space->machine->primary_screen->vblank() ? 0 : 0x80 | cg_clear_flag;
11641169
11651170      return vblank_bit;
11661171   }
r9041r9042
12271232   {
12281233      UINT32 i;
12291234      UINT8 *vram = memory_region(space->machine, "maincpu");
1235      UINT32 layer_bank;
12301236
1237      layer_bank = (cg_reg[0x0e] & 0x80) ? 0x10000 : 0x00000;
1238
12311239      /* TODO: this isn't yet 100% accurate */
12321240      if(cg_reg[0x05] & 1)
12331241      {
12341242         for(i=0;i<0x4000;i++)
1235            vram[i+0x40000] = 0x00; //clear B
1243            vram[i+0x40000+layer_bank] = 0x00; //clear B
12361244      }
12371245      if(cg_reg[0x05] & 2)
12381246      {
12391247         for(i=0;i<0x4000;i++)
1240            vram[i+0x44000] = 0x00; //clear R
1248            vram[i+0x44000+layer_bank] = 0x00; //clear R
12411249      }
12421250      if(cg_reg[0x05] & 4)
12431251      {
12441252         for(i=0;i<0x4000;i++)
1245            vram[i+0x48000] = 0x00; //clear G
1253            vram[i+0x48000+layer_bank] = 0x00; //clear G
12461254      }
12471255      if(cg_reg[0x05] & 8)
12481256      {
12491257         for(i=0;i<0x4000;i++)
1250            vram[i+0x4c000] = 0x00; //clear I
1258            vram[i+0x4c000+layer_bank] = 0x00; //clear I
12511259      }
1260      cg_clear_flag = 1;
12521261   }
12531262
12541263   {
r9041r9042
16221631      irq_mask[i] = 0;
16231632
16241633   kanji_bank = 0;
1634
1635   cg_clear_flag = 0;
16251636}
16261637
16271638static const gfx_layout mz2500_cg_layout =
r9041r9042
16921703{
16931704   if(irq_mask[0])
16941705      cpu_set_input_line_and_vector(device, 0, HOLD_LINE, irq_vector[0]);
1706
1707   cg_clear_flag = 0;
16951708}
16961709
16971710static READ8_DEVICE_HANDLER( mz2500_porta_r )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team