Previous 199869 Revisions Next

r18196 Friday 28th September, 2012 at 23:53:24 UTC by Barry Rodewald
(MESS) Bit more function renaming and variable shuffling. (no whatsnew)
[src/emu/video]pc_vga.c pc_vga.h
[src/mess/video]isa_svga_s3.c isa_vga_ati.c

trunk/src/emu/video/pc_vga.c
r18195r18196
208208   UINT8 enable_8514;
209209   UINT8 cr53;
210210   UINT16 current_cmd;
211   INT16 dest_x;
212   INT16 dest_y;
213   INT16 curr_x;
214   INT16 curr_y;
215   INT16 prev_x;
216   INT16 prev_y;
217211   UINT16 src_x;
218212   UINT16 src_y;
219   INT16 line_axial_step;
220   INT16 line_diagonal_step;
221   INT16 line_errorterm;
222213   UINT16 rect_width;
223214   UINT16 rect_height;
224215   UINT32 fgcolour;
r18195r18196
277268   UINT16 ec3;
278269   bool gpbusy;
279270   bool data_avail;
271   INT16 dest_x;
272   INT16 dest_y;
273   INT16 curr_x;
274   INT16 curr_y;
275   INT16 prev_x;
276   INT16 prev_y;
277   INT16 line_axial_step;
278   INT16 line_diagonal_step;
279   INT16 line_errorterm;
280280   int state;
281281
282282   UINT8 wait_vector_len;
r18195r18196
31513151   UINT8 src = 0;
31523152
31533153   // check clipping rectangle
3154   if(s3.curr_x < s3.scissors_left || s3.curr_x > s3.scissors_right || s3.curr_y < s3.scissors_top || s3.curr_y > s3.scissors_bottom)
3154   if(ibm8514.curr_x < s3.scissors_left || ibm8514.curr_x > s3.scissors_right || ibm8514.curr_y < s3.scissors_top || ibm8514.curr_y > s3.scissors_bottom)
31553155      return;  // do nothing
31563156
31573157   // determine source
r18195r18196
31683168      break;
31693169   case 0x0060:
31703170      // video memory - presume the memory is sourced from the current X/Y co-ords
3171      src = vga.memory[((s3.curr_y * VGA_LINE_LENGTH) + s3.curr_x) % vga.svga_intf.vram_size];
3171      src = vga.memory[((ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x) % vga.svga_intf.vram_size];
31723172      break;
31733173   }
31743174
r18195r18196
32323232   UINT8 src = 0;
32333233
32343234   // check clipping rectangle
3235   if(s3.curr_x < s3.scissors_left || s3.curr_x > s3.scissors_right || s3.curr_y < s3.scissors_top || s3.curr_y > s3.scissors_bottom)
3235   if(ibm8514.curr_x < s3.scissors_left || ibm8514.curr_x > s3.scissors_right || ibm8514.curr_y < s3.scissors_top || ibm8514.curr_y > s3.scissors_bottom)
32363236      return;  // do nothing
32373237
32383238   // determine source
r18195r18196
32493249      break;
32503250   case 0x0060:
32513251      // video memory - presume the memory is sourced from the current X/Y co-ords
3252      src = vga.memory[((s3.curr_y * VGA_LINE_LENGTH) + s3.curr_x) % vga.svga_intf.vram_size];
3252      src = vga.memory[((ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x) % vga.svga_intf.vram_size];
32533253      break;
32543254   }
32553255
r18195r18196
33163316   {
33173317   case 0x0000:  // Foreground Mix only
33183318      // check clipping rectangle
3319      if(s3.curr_x < s3.scissors_left || s3.curr_x > s3.scissors_right || s3.curr_y < s3.scissors_top || s3.curr_y > s3.scissors_bottom)
3319      if(ibm8514.curr_x < s3.scissors_left || ibm8514.curr_x > s3.scissors_right || ibm8514.curr_y < s3.scissors_top || ibm8514.curr_y > s3.scissors_bottom)
33203320         return;  // do nothing
33213321      s3_write_fg(offset);
33223322      break;
r18195r18196
33733373 */
33743374READ16_HANDLER(s3_line_error_r)
33753375{
3376   return s3.line_errorterm;
3376   return ibm8514.line_errorterm;
33773377}
33783378
33793379WRITE16_HANDLER(s3_line_error_w)
33803380{
3381   s3.line_errorterm = data;
3381   ibm8514.line_errorterm = data;
33823382   if(LOG_8514) logerror("S3: Line Parameter/Error Term write %04x\n",data);
33833383}
33843384
r18195r18196
34223422
34233423   while(x <= len)
34243424   {
3425      offset = (s3.curr_y * VGA_LINE_LENGTH) + s3.curr_x;
3425      offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x;
34263426      if(draw)
34273427         s3_write(offset,offset);
34283428      switch(dir)
34293429      {
34303430      case 0:  // 0 degrees
3431         s3.curr_x++;
3431         ibm8514.curr_x++;
34323432         break;
34333433      case 1:  // 45 degrees
3434         s3.curr_x++;
3435         s3.curr_y--;
3434         ibm8514.curr_x++;
3435         ibm8514.curr_y--;
34363436         break;
34373437      case 2:  // 90 degrees
3438         s3.curr_y--;
3438         ibm8514.curr_y--;
34393439         break;
34403440      case 3:  // 135 degrees
3441         s3.curr_y--;
3442         s3.curr_x--;
3441         ibm8514.curr_y--;
3442         ibm8514.curr_x--;
34433443         break;
34443444      case 4:  // 180 degrees
3445         s3.curr_x--;
3445         ibm8514.curr_x--;
34463446         break;
34473447      case 5:  // 225 degrees
3448         s3.curr_x--;
3449         s3.curr_y++;
3448         ibm8514.curr_x--;
3449         ibm8514.curr_y++;
34503450         break;
34513451      case 6:  // 270 degrees
3452         s3.curr_y++;
3452         ibm8514.curr_y++;
34533453         break;
34543454      case 7:  // 315 degrees
3455         s3.curr_y++;
3456         s3.curr_x++;
3455         ibm8514.curr_y++;
3456         ibm8514.curr_x++;
34573457         break;
34583458      }
34593459      x++;
r18195r18196
35863586         {
35873587            ibm8514.state = IBM8514_DRAWING_LINE;
35883588            ibm8514.data_avail = true;
3589            if(LOG_8514) logerror("S3: Command (%04x) - Vector Line (WAIT) %i,%i \n",s3.current_cmd,s3.curr_x,s3.curr_y);
3589            if(LOG_8514) logerror("S3: Command (%04x) - Vector Line (WAIT) %i,%i \n",s3.current_cmd,ibm8514.curr_x,ibm8514.curr_y);
35903590         }
35913591         else
35923592         {
35933593            ibm8514_draw_vector(s3.rect_width,(data & 0x00e0) >> 5,(data & 0010) ? true : false);
3594            if(LOG_8514) logerror("S3: Command (%04x) - Vector Line - %i,%i \n",s3.current_cmd,s3.curr_x,s3.curr_y);
3594            if(LOG_8514) logerror("S3: Command (%04x) - Vector Line - %i,%i \n",s3.current_cmd,ibm8514.curr_x,ibm8514.curr_y);
35953595         }
35963596      }
35973597      else
35983598      {
35993599         // Not perfect, but will do for now.
36003600         INT16 dx = s3.rect_width;
3601         INT16 dy = s3.line_axial_step >> 1;
3602         INT16 err = s3.line_errorterm;
3601         INT16 dy = ibm8514.line_axial_step >> 1;
3602         INT16 err = ibm8514.line_errorterm;
36033603         int sx = (data & 0x0020) ? 1 : -1;
36043604         int sy = (data & 0x0080) ? 1 : -1;
36053605         int count = 0;
36063606         INT16 temp;
36073607
36083608         if(LOG_8514) logerror("S3: Command (%04x) - Line (Bresenham) - %i,%i  Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",s3.current_cmd,
3609            s3.curr_x,s3.curr_y,s3.line_axial_step,s3.line_diagonal_step,s3.line_errorterm,s3.rect_width,s3.rect_height);
3609            ibm8514.curr_x,ibm8514.curr_y,ibm8514.line_axial_step,ibm8514.line_diagonal_step,ibm8514.line_errorterm,s3.rect_width,s3.rect_height);
36103610
36113611         if((data & 0x0040))
36123612         {
r18195r18196
36143614         }
36153615         for(;;)
36163616         {
3617            s3_write(s3.curr_x + (s3.curr_y * VGA_LINE_LENGTH),s3.curr_x + (s3.curr_y * VGA_LINE_LENGTH));
3617            s3_write(ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH),ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH));
36183618            if (count > s3.rect_width) break;
36193619            count++;
36203620            if((err*2) > -dy)
36213621            {
36223622               err -= dy;
3623               s3.curr_x += sx;
3623               ibm8514.curr_x += sx;
36243624            }
36253625            if((err*2) < dx)
36263626            {
36273627               err += dx;
3628               s3.curr_y += sy;
3628               ibm8514.curr_y += sy;
36293629            }
36303630         }
36313631      }
r18195r18196
36373637         //ibm8514.gpbusy = true;  // DirectX 5 keeps waiting for the busy bit to be clear...
36383638         s3.bus_size = (data & 0x0600) >> 9;
36393639         ibm8514.data_avail = true;
3640         if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,s3.curr_x,
3641               s3.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
3640         if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,ibm8514.curr_x,
3641               ibm8514.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
36423642         break;
36433643      }
3644      if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,s3.curr_x,
3645            s3.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
3644      if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,ibm8514.curr_x,
3645            ibm8514.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
36463646      off = 0;
3647      off += (VGA_LINE_LENGTH * s3.curr_y);
3648      off += s3.curr_x;
3647      off += (VGA_LINE_LENGTH * ibm8514.curr_y);
3648      off += ibm8514.curr_x;
36493649      for(y=0;y<=s3.rect_height;y++)
36503650      {
36513651         for(x=0;x<=s3.rect_width;x++)
r18195r18196
36563656               s3_write((off-x) % vga.svga_intf.vram_size,(off-x) % vga.svga_intf.vram_size);
36573657            if(s3.current_cmd & 0x0020)
36583658            {
3659               s3.curr_x++;
3660               if(s3.curr_x > s3.prev_x + s3.rect_width)
3659               ibm8514.curr_x++;
3660               if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width)
36613661               {
3662                  s3.curr_x = s3.prev_x;
3662                  ibm8514.curr_x = ibm8514.prev_x;
36633663                  s3.src_x = 0;
36643664                  if(s3.current_cmd & 0x0080)
3665                     s3.curr_y++;
3665                     ibm8514.curr_y++;
36663666                  else
3667                     s3.curr_y--;
3667                     ibm8514.curr_y--;
36683668               }
36693669            }
36703670            else
36713671            {
3672               s3.curr_x--;
3673               if(s3.curr_x < s3.prev_x - s3.rect_width)
3672               ibm8514.curr_x--;
3673               if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width)
36743674               {
3675                  s3.curr_x = s3.prev_x;
3675                  ibm8514.curr_x = ibm8514.prev_x;
36763676                  s3.src_x = 0;
36773677                  if(s3.current_cmd & 0x0080)
3678                     s3.curr_y++;
3678                     ibm8514.curr_y++;
36793679                  else
3680                     s3.curr_y--;
3680                     ibm8514.curr_y--;
36813681               }
36823682            }
36833683         }
r18195r18196
36913691      break;
36923692   case 0xc000:  // BitBLT
36933693      if(LOG_8514) logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",s3.current_cmd,
3694            s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
3694            ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,s3.rect_width,s3.rect_height);
36953695      off = 0;
3696      off += (VGA_LINE_LENGTH * s3.dest_y);
3697      off += s3.dest_x;
3696      off += (VGA_LINE_LENGTH * ibm8514.dest_y);
3697      off += ibm8514.dest_x;
36983698      src = 0;
3699      src += (VGA_LINE_LENGTH * s3.curr_y);
3700      src += s3.curr_x;
3699      src += (VGA_LINE_LENGTH * ibm8514.curr_y);
3700      src += ibm8514.curr_x;
37013701      for(y=0;y<=s3.rect_height;y++)
37023702      {
37033703         for(x=0;x<=s3.rect_width;x++)
r18195r18196
37083708               vga.memory[(off-x) % vga.svga_intf.vram_size] = vga.memory[(src-x) % vga.svga_intf.vram_size];
37093709            if(s3.current_cmd & 0x0020)
37103710            {
3711               s3.curr_x++;
3712               if(s3.curr_x > s3.prev_x + s3.rect_width)
3711               ibm8514.curr_x++;
3712               if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width)
37133713               {
3714                  s3.curr_x = s3.prev_x;
3714                  ibm8514.curr_x = ibm8514.prev_x;
37153715                  s3.src_x = 0;
37163716                  if(s3.current_cmd & 0x0080)
3717                     s3.curr_y++;
3717                     ibm8514.curr_y++;
37183718                  else
3719                     s3.curr_y--;
3719                     ibm8514.curr_y--;
37203720               }
37213721            }
37223722            else
37233723            {
3724               s3.curr_x--;
3725               if(s3.curr_x < s3.prev_x - s3.rect_width)
3724               ibm8514.curr_x--;
3725               if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width)
37263726               {
3727                  s3.curr_x = s3.prev_x;
3727                  ibm8514.curr_x = ibm8514.prev_x;
37283728                  s3.src_x = 0;
37293729                  if(s3.current_cmd & 0x0080)
3730                     s3.curr_y++;
3730                     ibm8514.curr_y++;
37313731                  else
3732                     s3.curr_y--;
3732                     ibm8514.curr_y--;
37333733               }
37343734            }
37353735         }
r18195r18196
37493749      break;
37503750   case 0xe000:  // Pattern Fill
37513751      if(LOG_8514) logerror("S3: Command (%04x) - Pattern Fill - source %i,%i  dest %i,%i  Width: %i Height: %i\n",s3.current_cmd,
3752            s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
3752            ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,s3.rect_width,s3.rect_height);
37533753      off = 0;
3754      off += (VGA_LINE_LENGTH * s3.dest_y);
3755      off += s3.dest_x;
3754      off += (VGA_LINE_LENGTH * ibm8514.dest_y);
3755      off += ibm8514.dest_x;
37563756      src = 0;
3757      src += (VGA_LINE_LENGTH * s3.curr_y);
3758      src += s3.curr_x;
3757      src += (VGA_LINE_LENGTH * ibm8514.curr_y);
3758      src += ibm8514.curr_x;
37593759      if(data & 0x0020)
37603760         pattern_x = 0;
37613761      else
r18195r18196
38403840     0-13  (80 x+) LINE PARAMETER AXIAL STEP CONSTANT. Se above
38413841
38423842 */
3843READ16_HANDLER( s3_8ae8_r )
3843READ16_HANDLER( ibm8514_desty_r )
38443844{
3845   return s3.line_axial_step;
3845   return ibm8514.line_axial_step;
38463846}
38473847
3848WRITE16_HANDLER( s3_8ae8_w )
3848WRITE16_HANDLER( ibm8514_desty_w )
38493849{
3850   s3.line_axial_step = data;
3851   s3.dest_y = data;
3852   if(LOG_8514) logerror("S3: Line Axial Step / Destination Y write %04x\n",data);
3850   ibm8514.line_axial_step = data;
3851   ibm8514.dest_y = data;
3852   if(LOG_8514) logerror("8514/A: Line Axial Step / Destination Y write %04x\n",data);
38533853}
38543854
38553855/*
r18195r18196
38653865     0-13  (80x +) LINE PARAMETER DIAGONAL STEP CONSTANT. Se above
38663866
38673867 */
3868READ16_HANDLER( s3_8ee8_r )
3868READ16_HANDLER( ibm8514_destx_r )
38693869{
3870   return s3.line_diagonal_step;
3870   return ibm8514.line_diagonal_step;
38713871}
38723872
3873WRITE16_HANDLER( s3_8ee8_w )
3873WRITE16_HANDLER( ibm8514_destx_w )
38743874{
3875   s3.line_diagonal_step = data;
3876   s3.dest_x = data;
3877   if(LOG_8514) logerror("S3: Line Diagonal Step / Destination X write %04x\n",data);
3875   ibm8514.line_diagonal_step = data;
3876   ibm8514.dest_x = data;
3877   if(LOG_8514) logerror("8514/A: Line Diagonal Step / Destination X write %04x\n",data);
38783878}
38793879
38803880/*
r18195r18196
39493949
39503950      if(ibm8514.state == IBM8514_DRAWING_SSV_1 || ibm8514.state == IBM8514_DRAWING_SSV_2)
39513951      {
3952         offset = (s3.curr_y * VGA_LINE_LENGTH) + s3.curr_x;
3952         offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x;
39533953         if(draw)
39543954            s3_write(offset,offset);
39553955         switch(dir)
39563956         {
39573957         case 0:  // 0 degrees
3958            s3.curr_x++;
3958            ibm8514.curr_x++;
39593959            break;
39603960         case 1:  // 45 degrees
3961            s3.curr_x++;
3962            s3.curr_y--;
3961            ibm8514.curr_x++;
3962            ibm8514.curr_y--;
39633963            break;
39643964         case 2:  // 90 degrees
3965            s3.curr_y--;
3965            ibm8514.curr_y--;
39663966            break;
39673967         case 3:  // 135 degrees
3968            s3.curr_y--;
3969            s3.curr_x--;
3968            ibm8514.curr_y--;
3969            ibm8514.curr_x--;
39703970            break;
39713971         case 4:  // 180 degrees
3972            s3.curr_x--;
3972            ibm8514.curr_x--;
39733973            break;
39743974         case 5:  // 225 degrees
3975            s3.curr_x--;
3976            s3.curr_y++;
3975            ibm8514.curr_x--;
3976            ibm8514.curr_y++;
39773977            break;
39783978         case 6:  // 270 degrees
3979            s3.curr_y++;
3979            ibm8514.curr_y++;
39803980            break;
39813981         case 7:  // 315 degrees
3982            s3.curr_y++;
3983            s3.curr_x++;
3982            ibm8514.curr_y++;
3983            ibm8514.curr_x++;
39843984            break;
39853985         }
39863986      }
r18195r18196
40614061
40624062      if(ibm8514.state == IBM8514_DRAWING_LINE)
40634063      {
4064         offset = (s3.curr_y * VGA_LINE_LENGTH) + s3.curr_x;
4064         offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x;
40654065         if(draw)
40664066            s3_write(offset,offset);
40674067         switch(dir)
40684068         {
40694069         case 0:  // 0 degrees
4070            s3.curr_x++;
4070            ibm8514.curr_x++;
40714071            break;
40724072         case 1:  // 45 degrees
4073            s3.curr_x++;
4074            s3.curr_y--;
4073            ibm8514.curr_x++;
4074            ibm8514.curr_y--;
40754075            break;
40764076         case 2:  // 90 degrees
4077            s3.curr_y--;
4077            ibm8514.curr_y--;
40784078            break;
40794079         case 3:  // 135 degrees
4080            s3.curr_y--;
4081            s3.curr_x--;
4080            ibm8514.curr_y--;
4081            ibm8514.curr_x--;
40824082            break;
40834083         case 4:  // 180 degrees
4084            s3.curr_x--;
4084            ibm8514.curr_x--;
40854085            break;
40864086         case 5:  // 225 degrees
4087            s3.curr_x--;
4088            s3.curr_y++;
4087            ibm8514.curr_x--;
4088            ibm8514.curr_y++;
40894089            break;
40904090         case 6:  // 270 degrees
4091            s3.curr_y++;
4091            ibm8514.curr_y++;
40924092            break;
40934093         case 7:  // 315 degrees
4094            s3.curr_y++;
4095            s3.curr_x++;
4094            ibm8514.curr_y++;
4095            ibm8514.curr_x++;
40964096            break;
40974097         }
40984098      }
r18195r18196
41194119   if(LOG_8514) logerror("S3: Major Axis Pixel Count / Rectangle Width write %04x\n",data);
41204120}
41214121
4122READ16_HANDLER(s3_currentx_r)
4122READ16_HANDLER(ibm8514_currentx_r)
41234123{
4124   return s3.curr_x;
4124   return ibm8514.curr_x;
41254125}
41264126
4127WRITE16_HANDLER(s3_currentx_w)
4127WRITE16_HANDLER(ibm8514_currentx_w)
41284128{
4129   s3.curr_x = data;
4130   s3.prev_x = data;
4131   if(LOG_8514) logerror("S3: Current X set to %04x (%i)\n",data,s3.curr_x);
4129   ibm8514.curr_x = data;
4130   ibm8514.prev_x = data;
4131   if(LOG_8514) logerror("8514/A: Current X set to %04x (%i)\n",data,ibm8514.curr_x);
41324132}
41334133
4134READ16_HANDLER(s3_currenty_r)
4134READ16_HANDLER(ibm8514_currenty_r)
41354135{
4136   return s3.curr_y;
4136   return ibm8514.curr_y;
41374137}
41384138
4139WRITE16_HANDLER(s3_currenty_w)
4139WRITE16_HANDLER(ibm8514_currenty_w)
41404140{
4141   s3.curr_y = data;
4142   s3.prev_y = data;
4143   if(LOG_8514) logerror("S3: Current Y set to %04x (%i)\n",data,s3.curr_y);
4141   ibm8514.curr_y = data;
4142   ibm8514.prev_y = data;
4143   if(LOG_8514) logerror("8514/A: Current Y set to %04x (%i)\n",data,ibm8514.curr_y);
41444144}
41454145
41464146READ16_HANDLER(s3_fgcolour_r)
r18195r18196
42904290   if(s3.bus_size == 2)  // 32-bit
42914291      data_size = 32;
42924292   off = 0;
4293   off += (VGA_LINE_LENGTH * s3.curr_y);
4294   off += s3.curr_x;
4293   off += (VGA_LINE_LENGTH * ibm8514.curr_y);
4294   off += ibm8514.curr_x;
42954295   if(s3.current_cmd & 0x02) // "across plane mode"
42964296   {
42974297      for(x=0;x<data_size;x++)
r18195r18196
43004300         if(s3.current_cmd & 0x0020)
43014301         {
43024302            off++;
4303            s3.curr_x++;
4304            if(s3.curr_x > s3.prev_x + s3.rect_width)
4303            ibm8514.curr_x++;
4304            if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width)
43054305            {
4306               s3.curr_x = s3.prev_x;
4306               ibm8514.curr_x = ibm8514.prev_x;
43074307               s3.src_x = 0;
43084308               if(s3.current_cmd & 0x0080)
43094309               {
4310                  s3.curr_y++;
4311                  if(s3.curr_y > s3.prev_y + s3.rect_height)
4310                  ibm8514.curr_y++;
4311                  if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height)
43124312                  {
43134313                     ibm8514.state = IBM8514_IDLE;
43144314                     ibm8514.data_avail = false;
r18195r18196
43174317               }
43184318               else
43194319               {
4320                  s3.curr_y--;
4321                  if(s3.curr_y < s3.prev_y - s3.rect_height)
4320                  ibm8514.curr_y--;
4321                  if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height)
43224322                  {
43234323                     ibm8514.state = IBM8514_IDLE;
43244324                     ibm8514.data_avail = false;
r18195r18196
43314331         else
43324332         {
43334333            off--;
4334            s3.curr_x--;
4335            if(s3.curr_x < s3.prev_x - s3.rect_width)
4334            ibm8514.curr_x--;
4335            if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width)
43364336            {
4337               s3.curr_x = s3.prev_x;
4337               ibm8514.curr_x = ibm8514.prev_x;
43384338               s3.src_x = 0;
43394339               if(s3.current_cmd & 0x0080)
43404340               {
4341                  s3.curr_y++;
4342                  if(s3.curr_y > s3.prev_y + s3.rect_height)
4341                  ibm8514.curr_y++;
4342                  if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height)
43434343                  {
43444344                     ibm8514.state = IBM8514_IDLE;
43454345                     ibm8514.gpbusy = false;
r18195r18196
43484348               }
43494349               else
43504350               {
4351                  s3.curr_y--;
4352                  if(s3.curr_y < s3.prev_y - s3.rect_height)
4351                  ibm8514.curr_y--;
4352                  if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height)
43534353                  {
43544354                     ibm8514.state = IBM8514_IDLE;
43554355                     ibm8514.gpbusy = false;
r18195r18196
43714371         if(s3.current_cmd & 0x0020)
43724372         {
43734373            off++;
4374            s3.curr_x++;
4375            if(s3.curr_x > s3.prev_x + s3.rect_width)
4374            ibm8514.curr_x++;
4375            if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width)
43764376            {
4377               s3.curr_x = s3.prev_x;
4377               ibm8514.curr_x = ibm8514.prev_x;
43784378               s3.src_x = 0;
43794379               if(s3.current_cmd & 0x0080)
43804380               {
4381                  s3.curr_y++;
4382                  if(s3.curr_y > s3.prev_y + s3.rect_height)
4381                  ibm8514.curr_y++;
4382                  if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height)
43834383                  {
43844384                     ibm8514.state = IBM8514_IDLE;
43854385                     ibm8514.gpbusy = false;
r18195r18196
43884388               }
43894389               else
43904390               {
4391                  s3.curr_y--;
4392                  if(s3.curr_y < s3.prev_y - s3.rect_height)
4391                  ibm8514.curr_y--;
4392                  if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height)
43934393                  {
43944394                     ibm8514.state = IBM8514_IDLE;
43954395                     ibm8514.gpbusy = false;
r18195r18196
44024402         else
44034403         {
44044404            off--;
4405            s3.curr_x--;
4406            if(s3.curr_x < s3.prev_x - s3.rect_width)
4405            ibm8514.curr_x--;
4406            if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width)
44074407            {
4408               s3.curr_x = s3.prev_x;
4408               ibm8514.curr_x = ibm8514.prev_x;
44094409               s3.src_x = 0;
44104410               if(s3.current_cmd & 0x0080)
44114411               {
4412                  s3.curr_y++;
4413                  if(s3.curr_y > s3.prev_y + s3.rect_height)
4412                  ibm8514.curr_y++;
4413                  if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height)
44144414                  {
44154415                     ibm8514.state = IBM8514_IDLE;
44164416                     ibm8514.gpbusy = false;
r18195r18196
44194419               }
44204420               else
44214421               {
4422                  s3.curr_y--;
4423                  if(s3.curr_y < s3.prev_y - s3.rect_height)
4422                  ibm8514.curr_y--;
4423                  if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height)
44244424                  {
44254425                     ibm8514.state = IBM8514_IDLE;
44264426                     ibm8514.gpbusy = false;
r18195r18196
45894589      {
45904590      case 0x8100:
45914591      case 0x82e8:
4592         s3.curr_y = (s3.curr_y & 0xff00) | data;
4593         s3.prev_y = (s3.prev_y & 0xff00) | data;
4592         ibm8514.curr_y = (ibm8514.curr_y & 0xff00) | data;
4593         ibm8514.prev_y = (ibm8514.prev_y & 0xff00) | data;
45944594         break;
45954595      case 0x8101:
45964596      case 0x82e9:
4597         s3.curr_y = (s3.curr_y & 0x00ff) | (data << 8);
4598         s3.prev_y = (s3.prev_y & 0x00ff) | (data << 8);
4597         ibm8514.curr_y = (ibm8514.curr_y & 0x00ff) | (data << 8);
4598         ibm8514.prev_y = (ibm8514.prev_y & 0x00ff) | (data << 8);
45994599         break;
46004600      case 0x8102:
46014601      case 0x86e8:
4602         s3.curr_x = (s3.curr_x & 0xff00) | data;
4603         s3.prev_x = (s3.prev_x & 0xff00) | data;
4602         ibm8514.curr_x = (ibm8514.curr_x & 0xff00) | data;
4603         ibm8514.prev_x = (ibm8514.prev_x & 0xff00) | data;
46044604         break;
46054605      case 0x8103:
46064606      case 0x86e9:
4607         s3.curr_x = (s3.curr_x & 0x00ff) | (data << 8);
4608         s3.prev_x = (s3.prev_x & 0x00ff) | (data << 8);
4607         ibm8514.curr_x = (ibm8514.curr_x & 0x00ff) | (data << 8);
4608         ibm8514.prev_x = (ibm8514.prev_x & 0x00ff) | (data << 8);
46094609         break;
46104610      case 0x8108:
46114611      case 0x8ae8:
4612         s3.line_axial_step = (s3.line_axial_step & 0xff00) | data;
4613         s3.dest_y = (s3.dest_y & 0xff00) | data;
4612         ibm8514.line_axial_step = (ibm8514.line_axial_step & 0xff00) | data;
4613         ibm8514.dest_y = (ibm8514.dest_y & 0xff00) | data;
46144614         break;
46154615      case 0x8109:
46164616      case 0x8ae9:
4617         s3.line_axial_step = (s3.line_axial_step & 0x00ff) | ((data & 0x3f) << 8);
4618         s3.dest_y = (s3.dest_y & 0x00ff) | (data << 8);
4617         ibm8514.line_axial_step = (ibm8514.line_axial_step & 0x00ff) | ((data & 0x3f) << 8);
4618         ibm8514.dest_y = (ibm8514.dest_y & 0x00ff) | (data << 8);
46194619         break;
46204620      case 0x810a:
46214621      case 0x8ee8:
4622         s3.line_diagonal_step = (s3.line_diagonal_step & 0xff00) | data;
4623         s3.dest_x = (s3.dest_x & 0xff00) | data;
4622         ibm8514.line_diagonal_step = (ibm8514.line_diagonal_step & 0xff00) | data;
4623         ibm8514.dest_x = (ibm8514.dest_x & 0xff00) | data;
46244624         break;
46254625      case 0x810b:
46264626      case 0x8ee9:
4627         s3.line_diagonal_step = (s3.line_diagonal_step & 0x00ff) | ((data & 0x3f) << 8);
4628         s3.dest_x = (s3.dest_x & 0x00ff) | (data << 8);
4627         ibm8514.line_diagonal_step = (ibm8514.line_diagonal_step & 0x00ff) | ((data & 0x3f) << 8);
4628         ibm8514.dest_x = (ibm8514.dest_x & 0x00ff) | (data << 8);
46294629         break;
46304630      case 0x8118:
46314631      case 0x9ae8:
r18195r18196
52805280   switch(ati.linedraw)
52815281   {
52825282   case 0:  // Set current X
5283      s3.curr_x = data;
5283      ibm8514.curr_x = data;
52845284      ati.linedraw++;
52855285      break;
52865286   case 1:  // Set current Y
5287      s3.curr_y = data;
5287      ibm8514.curr_y = data;
52885288      ati.linedraw++;
52895289      break;
52905290   case 2:  // Line end X
5291      s3.curr_x = data;
5291      ibm8514.curr_x = data;
52925292      ati.linedraw++;
52935293      break;
52945294   case 3:  // Line end Y
5295      s3.curr_y = data;
5295      ibm8514.curr_y = data;
52965296      ati.linedraw = 2;
52975297      break;
52985298   case 4:  // Set current X
5299      s3.curr_x = data;
5299      ibm8514.curr_x = data;
53005300      ati.linedraw++;
53015301      break;
53025302   case 5:  // Set current Y
5303      s3.curr_y = data;
5303      ibm8514.curr_y = data;
53045304      ati.linedraw = 4;
53055305      break;
53065306   }
trunk/src/emu/video/pc_vga.h
r18195r18196
7171DECLARE_WRITE16_HANDLER(s3_cmd_w);
7272DECLARE_READ16_HANDLER(ibm8514_ssv_r);
7373DECLARE_WRITE16_HANDLER(ibm8514_ssv_w);
74DECLARE_READ16_HANDLER(s3_8ae8_r);
75DECLARE_WRITE16_HANDLER(s3_8ae8_w);
76DECLARE_READ16_HANDLER(s3_8ee8_r);
77DECLARE_WRITE16_HANDLER(s3_8ee8_w);
78DECLARE_READ16_HANDLER(s3_currentx_r);
79DECLARE_WRITE16_HANDLER(s3_currentx_w);
80DECLARE_READ16_HANDLER(s3_currenty_r);
81DECLARE_WRITE16_HANDLER(s3_currenty_w);
74DECLARE_READ16_HANDLER(ibm8514_desty_r);
75DECLARE_WRITE16_HANDLER(ibm8514_desty_w);
76DECLARE_READ16_HANDLER(ibm8514_destx_r);
77DECLARE_WRITE16_HANDLER(ibm8514_destx_w);
78DECLARE_READ16_HANDLER(ibm8514_currentx_r);
79DECLARE_WRITE16_HANDLER(ibm8514_currentx_w);
80DECLARE_READ16_HANDLER(ibm8514_currenty_r);
81DECLARE_WRITE16_HANDLER(ibm8514_currenty_w);
8282DECLARE_READ16_HANDLER(s3_line_error_r);
8383DECLARE_WRITE16_HANDLER(s3_line_error_w);
8484DECLARE_READ16_HANDLER(s3_width_r);
trunk/src/mess/video/isa_svga_s3.c
r18195r18196
7878   m_isa->install_device(0x03b0, 0x03bf, 0, 0, FUNC(s3_port_03b0_r), FUNC(s3_port_03b0_w));
7979   m_isa->install_device(0x03c0, 0x03cf, 0, 0, FUNC(s3_port_03c0_r), FUNC(s3_port_03c0_w));
8080   m_isa->install_device(0x03d0, 0x03df, 0, 0, FUNC(s3_port_03d0_r), FUNC(s3_port_03d0_w));
81   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, FUNC(s3_currenty_r), FUNC(s3_currenty_w));
82   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, FUNC(s3_currentx_r), FUNC(s3_currentx_w));
83   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, FUNC(s3_8ae8_r), FUNC(s3_8ae8_w));
84   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, FUNC(s3_8ee8_r), FUNC(s3_8ee8_w));
81   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, FUNC(ibm8514_currenty_r), FUNC(ibm8514_currenty_w));
82   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, FUNC(ibm8514_currentx_r), FUNC(ibm8514_currentx_w));
83   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, FUNC(ibm8514_desty_r), FUNC(ibm8514_desty_w));
84   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, FUNC(ibm8514_destx_r), FUNC(ibm8514_destx_w));
8585   m_isa->install16_device(0x92e8, 0x92eb, 0, 0, FUNC(s3_line_error_r), FUNC(s3_line_error_w));
8686   m_isa->install16_device(0x96e8, 0x96eb, 0, 0, FUNC(s3_width_r), FUNC(s3_width_w));
8787   m_isa->install16_device(0x9ae8, 0x9aeb, 0, 0, FUNC(s3_gpstatus_r), FUNC(s3_cmd_w));
trunk/src/mess/video/isa_vga_ati.c
r18195r18196
9797   m_isa->install16_device(0x56ec, 0x56ef, 0, 0, FUNC(mach8_scratch0_r), FUNC(mach8_scratch0_w));
9898   m_isa->install16_device(0x5ae8, 0x5aeb, 0, 0, FUNC(mach8_ec2_r), FUNC(mach8_ec2_w));
9999   m_isa->install16_device(0x5ee8, 0x5eeb, 0, 0, FUNC(mach8_ec3_r), FUNC(mach8_ec3_w));
100   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, FUNC(s3_currenty_r), FUNC(s3_currenty_w));
101   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, FUNC(s3_currentx_r), FUNC(s3_currentx_w));
102   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, FUNC(s3_8ae8_r), FUNC(s3_8ae8_w));
103   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, FUNC(s3_8ee8_r), FUNC(s3_8ee8_w));
100   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, FUNC(ibm8514_currenty_r), FUNC(ibm8514_currenty_w));
101   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, FUNC(ibm8514_currentx_r), FUNC(ibm8514_currentx_w));
102   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, FUNC(ibm8514_desty_r), FUNC(ibm8514_desty_w));
103   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, FUNC(ibm8514_destx_r), FUNC(ibm8514_destx_w));
104104   m_isa->install16_device(0x92e8, 0x92eb, 0, 0, FUNC(s3_line_error_r), FUNC(s3_line_error_w));
105105   m_isa->install16_device(0x96e8, 0x96eb, 0, 0, FUNC(s3_width_r), FUNC(s3_width_w));
106106   m_isa->install16_device(0x96ec, 0x96ef, 0, 0, FUNC(mach8_bresenham_count_r), FUNC(mach8_bresenham_count_w));

Previous 199869 Revisions Next


© 1997-2024 The MAME Team