Previous 15994 Revisions Next

r13503 Wednesday 7th December, 2011 at 20:58:46 UTC by Wilbert Pol
smsvdp.c: Added rendering of the Y1 signal in a separate bitmap. (nw)
[src/mess/video]smsvdp.c smsvdp.h

src/mess/video/smsvdp.c
r13502r13503
502502      rec.min_x = SMS_LBORDER_START;
503503      rec.max_x = SMS_LBORDER_START + SMS_LBORDER_X_PIXELS - 1;
504504      bitmap_fill(m_tmpbitmap, &rec, machine().pens[m_current_palette[BACKDROP_COLOR]]);
505      bitmap_fill(m_y1_bitmap, &rec, 1);
505506
506507      /* Draw right border */
507508      rec.min_x = SMS_LBORDER_START + SMS_LBORDER_X_PIXELS + 256;
508509      rec.max_x = rec.min_x + SMS_RBORDER_X_PIXELS - 1;
509510      bitmap_fill(m_tmpbitmap, &rec, machine().pens[m_current_palette[BACKDROP_COLOR]]);
511      bitmap_fill(m_y1_bitmap, &rec, 1);
510512
511513      /* Draw middle of the border */
512514      /* We need to do this through the regular drawing function so it will */
r13502r13503
533535      rec.min_x = SMS_LBORDER_START;
534536      rec.max_x = SMS_LBORDER_START + SMS_LBORDER_X_PIXELS - 1;
535537      bitmap_fill(m_tmpbitmap, &rec, machine().pens[m_current_palette[BACKDROP_COLOR]]);
538      bitmap_fill(m_y1_bitmap, &rec, 1);
536539
537540      /* Draw right border */
538541      rec.min_x = SMS_LBORDER_START + SMS_LBORDER_X_PIXELS + 256;
539542      rec.max_x = rec.min_x + SMS_RBORDER_X_PIXELS - 1;
540543      bitmap_fill(m_tmpbitmap, &rec, machine().pens[m_current_palette[BACKDROP_COLOR]]);
544      bitmap_fill(m_y1_bitmap, &rec, 1);
541545
542546      refresh_line( SMS_LBORDER_START + SMS_LBORDER_X_PIXELS, vpos_limit, vpos - vpos_limit );
543547
r13502r13503
556560      rec.min_x = SMS_LBORDER_START;
557561      rec.max_x = SMS_LBORDER_START + SMS_LBORDER_X_PIXELS - 1;
558562      bitmap_fill(m_tmpbitmap, &rec, machine().pens[m_current_palette[BACKDROP_COLOR]]);
563      bitmap_fill(m_y1_bitmap, &rec, 1);
559564
560565      /* Draw right border */
561566      rec.min_x = SMS_LBORDER_START + SMS_LBORDER_X_PIXELS + 256;
562567      rec.max_x = rec.min_x + SMS_RBORDER_X_PIXELS - 1;
563568      bitmap_fill(m_tmpbitmap, &rec, machine().pens[m_current_palette[BACKDROP_COLOR]]);
569      bitmap_fill(m_y1_bitmap, &rec, 1);
564570
565571      /* Draw middle of the border */
566572      /* We need to do this through the regular drawing function so it will */
r13502r13503
13861392   switch( m_vdp_mode )
13871393   {
13881394   case 0:
1395      memset(priority_selected, 1, sizeof(priority_selected));
13891396      if (line >= 0 && line < m_frame_timing[ACTIVE_DISPLAY_V])
13901397      {
13911398         refresh_line_mode0( blitline_buffer, line );
r13502r13503
13941401      break;
13951402
13961403   case 2:
1404      memset(priority_selected, 1, sizeof(priority_selected));
13971405      if (line >= 0 && line < m_frame_timing[ACTIVE_DISPLAY_V])
13981406      {
13991407         refresh_line_mode2( blitline_buffer, line );
r13502r13503
14121420      break;
14131421   }
14141422
1423   UINT32 *p_bitmap = BITMAP_ADDR32(m_tmpbitmap, pixel_plot_y + line, pixel_offset_x);
1424   UINT8  *p_y1 = BITMAP_ADDR8(m_y1_bitmap, pixel_plot_y + line, pixel_offset_x);
1425
14151426   /* Check if display is disabled or we're below/above active area */
14161427   if (!(m_reg[0x01] & 0x40) || line < 0 || line >= m_frame_timing[ACTIVE_DISPLAY_V])
14171428   {
14181429      for (x = 0; x < 256; x++)
14191430      {
1420         blitline_buffer[x] = m_current_palette[BACKDROP_COLOR];
1431         p_bitmap[x] = machine().pens[m_current_palette[BACKDROP_COLOR]];
1432         p_y1[x] = 1;
14211433      }
14221434   }
1423
1424   for (x = 0; x < 256; x++)
1435   else
14251436   {
1426      *BITMAP_ADDR32(m_tmpbitmap, pixel_plot_y + line, pixel_offset_x + x) = machine().pens[blitline_buffer[x]];
1437      for (x = 0; x < 256; x++)
1438      {
1439         p_bitmap[x] = machine().pens[blitline_buffer[x]];
1440         p_y1[x] = ( priority_selected[x] & 0x0f ) ? 0 : 1;
1441      }
14271442   }
14281443}
14291444
r13502r13503
16781693
16791694   /* Make temp bitmap for rendering */
16801695   m_tmpbitmap = auto_bitmap_alloc(machine(), width, height, BITMAP_FORMAT_INDEXED32);
1696   m_y1_bitmap = auto_bitmap_alloc(machine(), width, height, BITMAP_FORMAT_INDEXED8);
16811697
16821698   m_smsvdp_display_timer = timer_alloc(TIMER_LINE);
16831699   m_smsvdp_display_timer->adjust(m_screen->time_until_pos(0, DISPLAY_CB_HPOS), 0, m_screen->scan_period());
r13502r13503
17051721   save_pointer(NAME(m_line_buffer), 256 * 5);
17061722   save_pointer(NAME(m_collision_buffer), SMS_X_PIXELS);
17071723   save_item(NAME(*m_tmpbitmap));
1724   save_item(NAME(*m_y1_bitmap));
17081725}
17091726
17101727
src/mess/video/smsvdp.h
r13502r13503
121121   memory_region    *m_CRAM;                    /* Pointer to CRAM */
122122   const UINT8      *m_frame_timing;
123123   bitmap_t         *m_tmpbitmap;
124   bitmap_t         *m_y1_bitmap;
124125   UINT8            *m_collision_buffer;
125126   UINT8            m_palette_offset;
126127

Previous 15994 Revisions Next


© 1998-2018 The MESS Team