Previous 199869 Revisions Next

r18170 Thursday 27th September, 2012 at 06:22:08 UTC by Barry Rodewald
(MESS) Made logerror output from 8514/A related functions optional (no whatsnew)
[src/emu/video]pc_vga.c

trunk/src/emu/video/pc_vga.c
r18169r18170
326326#define LOG_ACCESSES   0
327327#define LOG_REGISTERS   0
328328
329#define LOG_8514      0
330
329331static VIDEO_RESET( vga );
330332
331333/***************************************************************************
r18169r18170
30183020               fatalerror("TODO: s3 bank selects above 1M\n");
30193021            break;
30203022         default:
3021            logerror("S3: 3D4 index %02x write %02x\n",index,data);
3023            if(LOG_8514) logerror("S3: 3D4 index %02x write %02x\n",index,data);
30223024            break;
30233025      }
30243026   }
r18169r18170
33773379WRITE16_HANDLER(s3_line_error_w)
33783380{
33793381   s3.line_errorterm = data;
3380   logerror("S3: Line Parameter/Error Term write %04x\n",data);
3382   if(LOG_8514) logerror("S3: Line Parameter/Error Term write %04x\n",data);
33813383}
33823384
33833385/*
r18169r18170
34053407{
34063408   UINT16 ret = 0x0000;
34073409
3408   //logerror("S3: 9AE8 read\n");
3410   //if(LOG_8514) logerror("S3: 9AE8 read\n");
34093411   if(ibm8514.gpbusy == true)
34103412      ret |= 0x0200;
34113413   if(ibm8514.data_avail == true)
r18169r18170
34623464{
34633465   UINT16 ret = 0x0000;
34643466
3465   //logerror("S3: 9AE8 read\n");
3467   //if(LOG_8514) logerror("S3: 9AE8 read\n");
34663468   if(s3.enable_8514 != 0)
34673469   {
34683470      if(ibm8514.gpbusy == true)
r18169r18170
35733575   case 0x0000:  // NOP (for "Short Stroke Vectors")
35743576      ibm8514.state = IBM8514_IDLE;
35753577      ibm8514.gpbusy = false;
3576      logerror("S3: Command (%04x) - NOP (Short Stroke Vector)\n",s3.current_cmd);
3578      if(LOG_8514) logerror("S3: Command (%04x) - NOP (Short Stroke Vector)\n",s3.current_cmd);
35773579      break;
35783580   case 0x2000:  // Line
35793581      ibm8514.state = IBM8514_IDLE;
r18169r18170
35843586         {
35853587            ibm8514.state = IBM8514_DRAWING_LINE;
35863588            ibm8514.data_avail = true;
3587            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,s3.curr_x,s3.curr_y);
35883590         }
35893591         else
35903592         {
35913593            ibm8514_draw_vector(s3.rect_width,(data & 0x00e0) >> 5,(data & 0010) ? true : false);
3592            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,s3.curr_x,s3.curr_y);
35933595         }
35943596      }
35953597      else
r18169r18170
36033605         int count = 0;
36043606         INT16 temp;
36053607
3606         logerror("S3: Command (%04x) - Line (Bresenham) - %i,%i  Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",s3.current_cmd,
3608         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,
36073609            s3.curr_x,s3.curr_y,s3.line_axial_step,s3.line_diagonal_step,s3.line_errorterm,s3.rect_width,s3.rect_height);
36083610
36093611         if((data & 0x0040))
r18169r18170
36353637         //ibm8514.gpbusy = true;  // DirectX 5 keeps waiting for the busy bit to be clear...
36363638         s3.bus_size = (data & 0x0600) >> 9;
36373639         ibm8514.data_avail = true;
3638         logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,s3.curr_x,
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,
36393641               s3.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
36403642         break;
36413643      }
3642      logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,s3.curr_x,
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,
36433645            s3.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
36443646      off = 0;
36453647      off += (VGA_LINE_LENGTH * s3.curr_y);
r18169r18170
36883690      ibm8514.gpbusy = false;
36893691      break;
36903692   case 0xc000:  // BitBLT
3691      logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",s3.current_cmd,
3693      if(LOG_8514) logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",s3.current_cmd,
36923694            s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
36933695      off = 0;
36943696      off += (VGA_LINE_LENGTH * s3.dest_y);
r18169r18170
37463748      ibm8514.gpbusy = false;
37473749      break;
37483750   case 0xe000:  // Pattern Fill
3749      logerror("S3: Command (%04x) - Pattern Fill - source %i,%i  dest %i,%i  Width: %i Height: %i\n",s3.current_cmd,
3751      if(LOG_8514) logerror("S3: Command (%04x) - Pattern Fill - source %i,%i  dest %i,%i  Width: %i Height: %i\n",s3.current_cmd,
37503752            s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
37513753      off = 0;
37523754      off += (VGA_LINE_LENGTH * s3.dest_y);
r18169r18170
38173819   default:
38183820      ibm8514.state = IBM8514_IDLE;
38193821      ibm8514.gpbusy = false;
3820      logerror("S3: Unknown command: %04x\n",data);
3822      if(LOG_8514) logerror("S3: Unknown command: %04x\n",data);
38213823   }
38223824}
38233825
r18169r18170
38473849{
38483850   s3.line_axial_step = data;
38493851   s3.dest_y = data;
3850   logerror("S3: Line Axial Step / Destination Y write %04x\n",data);
3852   if(LOG_8514) logerror("S3: Line Axial Step / Destination Y write %04x\n",data);
38513853}
38523854
38533855/*
r18169r18170
38723874{
38733875   s3.line_diagonal_step = data;
38743876   s3.dest_x = data;
3875   logerror("S3: Line Diagonal Step / Destination X write %04x\n",data);
3877   if(LOG_8514) logerror("S3: Line Diagonal Step / Destination X write %04x\n",data);
38763878}
38773879
38783880/*
r18169r18170
40244026      ibm8514_draw_ssv(data >> 8);
40254027      ibm8514_draw_ssv(data & 0xff);
40264028   }
4027   logerror("8514/A: Short Stroke Vector write %04x\n",data);
4029   if(LOG_8514) logerror("8514/A: Short Stroke Vector write %04x\n",data);
40284030}
40294031
40304032static void ibm8514_wait_draw_vector()
r18169r18170
41144116WRITE16_HANDLER( s3_width_w )
41154117{
41164118   s3.rect_width = data & 0x1fff;
4117   logerror("S3: Major Axis Pixel Count / Rectangle Width write %04x\n",data);
4119   if(LOG_8514) logerror("S3: Major Axis Pixel Count / Rectangle Width write %04x\n",data);
41184120}
41194121
41204122READ16_HANDLER(s3_currentx_r)
r18169r18170
41264128{
41274129   s3.curr_x = data;
41284130   s3.prev_x = data;
4129   logerror("S3: Current X set to %04x (%i)\n",data,s3.curr_x);
4131   if(LOG_8514) logerror("S3: Current X set to %04x (%i)\n",data,s3.curr_x);
41304132}
41314133
41324134READ16_HANDLER(s3_currenty_r)
r18169r18170
41384140{
41394141   s3.curr_y = data;
41404142   s3.prev_y = data;
4141   logerror("S3: Current Y set to %04x (%i)\n",data,s3.curr_y);
4143   if(LOG_8514) logerror("S3: Current Y set to %04x (%i)\n",data,s3.curr_y);
41424144}
41434145
41444146READ16_HANDLER(s3_fgcolour_r)
r18169r18170
41494151WRITE16_HANDLER(s3_fgcolour_w)
41504152{
41514153   s3.fgcolour = data;
4152   logerror("S3: Foreground Colour write %04x\n",data);
4154   if(LOG_8514) logerror("S3: Foreground Colour write %04x\n",data);
41534155}
41544156
41554157READ16_HANDLER(s3_bgcolour_r)
r18169r18170
41604162WRITE16_HANDLER(s3_bgcolour_w)
41614163{
41624164   s3.bgcolour = data;
4163   logerror("S3: Background Colour write %04x\n",data);
4165   if(LOG_8514) logerror("S3: Background Colour write %04x\n",data);
41644166}
41654167
41664168READ16_HANDLER( s3_multifunc_r )
r18169r18170
41794181      return s3.scissors_right;
41804182      // TODO: remaining functions
41814183   default:
4182      logerror("S3: Unimplemented multifunction register %i selected\n",s3.multifunc_sel);
4184      if(LOG_8514) logerror("S3: Unimplemented multifunction register %i selected\n",s3.multifunc_sel);
41834185      return 0xff;
41844186   }
41854187}
r18169r18170
41964198*/
41974199   case 0x0000:
41984200      s3.rect_height = data & 0x0fff;
4199      logerror("S3: Minor Axis Pixel Count / Rectangle Height write %04x\n",data);
4201      if(LOG_8514) logerror("S3: Minor Axis Pixel Count / Rectangle Height write %04x\n",data);
42004202      break;
42014203/*
42024204BEE8h index 01h W(R/W):  Top Scissors Register (SCISSORS_T).
r18169r18170
42214223 */
42224224   case 0x1000:
42234225      s3.scissors_top = data & 0x0fff;
4224      logerror("S3: Scissors Top write %04x\n",data);
4226      if(LOG_8514) logerror("S3: Scissors Top write %04x\n",data);
42254227      break;
42264228   case 0x2000:
42274229      s3.scissors_left = data & 0x0fff;
4228      logerror("S3: Scissors Left write %04x\n",data);
4230      if(LOG_8514) logerror("S3: Scissors Left write %04x\n",data);
42294231      break;
42304232   case 0x3000:
42314233      s3.scissors_bottom = data & 0x0fff;
4232      logerror("S3: Scissors Bottom write %04x\n",data);
4234      if(LOG_8514) logerror("S3: Scissors Bottom write %04x\n",data);
42334235      break;
42344236   case 0x4000:
42354237      s3.scissors_right = data & 0x0fff;
4236      logerror("S3: Scissors Right write %04x\n",data);
4238      if(LOG_8514) logerror("S3: Scissors Right write %04x\n",data);
42374239      break;
42384240/*
42394241BEE8h index 0Ah W(R/W):  Pixel Control Register (PIX_CNTL).
r18169r18170
42474249 */
42484250   case 0xa000:
42494251      s3.pixel_control = data;
4250      logerror("S3: Pixel control write %04x\n",data);
4252      if(LOG_8514) logerror("S3: Pixel control write %04x\n",data);
42514253      break;
42524254/*
42534255BEE8h index 0Fh W(W):  Read Register Select Register (READ_SEL)    (801/5,928)
r18169r18170
42694271 */
42704272   case 0xf000:
42714273      s3.multifunc_sel = data & 0x000f;
4272      logerror("S3: Multifunction select write %04x\n",data);
4274      if(LOG_8514) logerror("S3: Multifunction select write %04x\n",data);
42734275   default:
4274      logerror("S3: Unimplemented multifunction register %i write %03x\n",data >> 12,data & 0x0fff);
4276      if(LOG_8514) logerror("S3: Unimplemented multifunction register %i write %03x\n",data >> 12,data & 0x0fff);
42754277   }
42764278}
42774279
r18169r18170
44674469WRITE16_HANDLER(s3_backmix_w)
44684470{
44694471   s3.bgmix = data;
4470   logerror("S3: BG Mix write %04x\n",data);
4472   if(LOG_8514) logerror("S3: BG Mix write %04x\n",data);
44714473}
44724474
44734475READ16_HANDLER(s3_foremix_r)
r18169r18170
44784480WRITE16_HANDLER(s3_foremix_w)
44794481{
44804482   s3.fgmix = data;
4481   logerror("S3: FG Mix write %04x\n",data);
4483   if(LOG_8514) logerror("S3: FG Mix write %04x\n",data);
44824484}
44834485
44844486READ16_HANDLER(s3_pixel_xfer_r)
r18169r18170
45054507   if(ibm8514.state == IBM8514_DRAWING_LINE)
45064508      ibm8514_wait_draw_vector();
45074509
4508   logerror("S3: Pixel Transfer = %08x\n",s3.pixel_xfer);
4510   if(LOG_8514) logerror("S3: Pixel Transfer = %08x\n",s3.pixel_xfer);
45094511}
45104512
45114513READ8_HANDLER( s3_mem_r )
r18169r18170
47394741         s3_multifunc_w(space,0,s3.mmio_bee8,0xffff);
47404742         break;
47414743      default:
4742         logerror("S3: MMIO offset %05x write %02x\n",offset+0xa0000,data);
4744         if(LOG_8514) logerror("S3: MMIO offset %05x write %02x\n",offset+0xa0000,data);
47434745      }
47444746      return;
47454747   }
r18169r18170
51065108{
51075109   ibm8514.htotal = data & 0x01ff;
51085110   //vga.crtc.horz_total = data & 0x01ff;
5109   logerror("8514/A: Horizontal total write %04x\n",data);
5111   if(LOG_8514) logerror("8514/A: Horizontal total write %04x\n",data);
51105112}
51115113
51125114/*
r18169r18170
51585160{
51595161   ibm8514.subctrl = data;
51605162   ibm8514.substatus &= ~(data & 0x0f);  // reset interrupts
5161//  logerror("8514/A: Subsystem control write %04x\n",data);
5163//  if(LOG_8514) logerror("8514/A: Subsystem control write %04x\n",data);
51625164}
51635165
51645166READ16_HANDLER(ibm8514_subcontrol_r)
r18169r18170
51805182{
51815183   ibm8514.vtotal = data;
51825184//  vga.crtc.vert_total = data;
5183   logerror("8514/A: Vertical total write %04x\n",data);
5185   if(LOG_8514) logerror("8514/A: Vertical total write %04x\n",data);
51845186}
51855187
51865188READ16_HANDLER(ibm8514_vdisp_r)
r18169r18170
51925194{
51935195   ibm8514.vdisp = data;
51945196//  vga.crtc.vert_disp_end = data >> 3;
5195   logerror("8514/A: Vertical Displayed write %04x\n",data);
5197   if(LOG_8514) logerror("8514/A: Vertical Displayed write %04x\n",data);
51965198}
51975199
51985200READ16_HANDLER(ibm8514_vsync_r)
r18169r18170
52035205WRITE16_HANDLER(ibm8514_vsync_w)
52045206{
52055207   ibm8514.vsync = data;
5206   logerror("8514/A: Vertical Sync write %04x\n",data);
5208   if(LOG_8514) logerror("8514/A: Vertical Sync write %04x\n",data);
52075209}
52085210
52095211READ16_HANDLER(mach8_ec0_r)
r18169r18170
52145216WRITE16_HANDLER(mach8_ec0_w)
52155217{
52165218   ibm8514.ec0 = data;
5217   logerror("8514/A: Extended configuration 0 write %04x\n",data);
5219   if(LOG_8514) logerror("8514/A: Extended configuration 0 write %04x\n",data);
52185220}
52195221
52205222READ16_HANDLER(mach8_ec1_r)
r18169r18170
52255227WRITE16_HANDLER(mach8_ec1_w)
52265228{
52275229   ibm8514.ec1 = data;
5228   logerror("8514/A: Extended configuration 1 write %04x\n",data);
5230   if(LOG_8514) logerror("8514/A: Extended configuration 1 write %04x\n",data);
52295231}
52305232
52315233READ16_HANDLER(mach8_ec2_r)
r18169r18170
52365238WRITE16_HANDLER(mach8_ec2_w)
52375239{
52385240   ibm8514.ec2 = data;
5239   logerror("8514/A: Extended configuration 2 write %04x\n",data);
5241   if(LOG_8514) logerror("8514/A: Extended configuration 2 write %04x\n",data);
52405242}
52415243
52425244READ16_HANDLER(mach8_ec3_r)
r18169r18170
52475249WRITE16_HANDLER(mach8_ec3_w)
52485250{
52495251   ibm8514.ec3 = data;
5250   logerror("8514/A: Extended configuration 3 write %04x\n",data);
5252   if(LOG_8514) logerror("8514/A: Extended configuration 3 write %04x\n",data);
52515253}
52525254
52535255READ16_HANDLER(mach8_ext_fifo_r)
r18169r18170
52585260WRITE16_HANDLER(mach8_linedraw_index_w)
52595261{
52605262   ati.linedraw = data & 0x07;
5261   logerror("Mach8: Line Draw Index write %04x\n",data);
5263   if(LOG_8514) logerror("Mach8: Line Draw Index write %04x\n",data);
52625264}
52635265
52645266READ16_HANDLER(mach8_bresenham_count_r)
r18169r18170
52695271WRITE16_HANDLER(mach8_bresenham_count_w)
52705272{
52715273   s3.rect_width = data & 0x1fff;
5272   logerror("Mach8: Bresenham count write %04x\n",data);
5274   if(LOG_8514) logerror("Mach8: Bresenham count write %04x\n",data);
52735275}
52745276
52755277WRITE16_HANDLER(mach8_linedraw_w)
r18169r18170
53135315WRITE16_HANDLER(mach8_scratch0_w)
53145316{
53155317   ati.scratch0 = data;
5316   logerror("Mach8: Scratch Pad 0 write %04x\n",data);
5318   if(LOG_8514) logerror("Mach8: Scratch Pad 0 write %04x\n",data);
53175319}
53185320
53195321READ16_HANDLER(mach8_scratch1_r)
r18169r18170
53245326WRITE16_HANDLER(mach8_scratch1_w)
53255327{
53265328   ati.scratch1 = data;
5327   logerror("Mach8: Scratch Pad 1 write %04x\n",data);
5329   if(LOG_8514) logerror("Mach8: Scratch Pad 1 write %04x\n",data);
53285330}
53295331
53305332/*

Previous 199869 Revisions Next


© 1997-2024 The MAME Team