Previous 199869 Revisions Next

r17521 Tuesday 28th August, 2012 at 01:24:13 UTC by Barry Rodewald
(MESS) svga_s3: Minor fixes relating to text drawn at negative coordinates. (no whatsnew)
[src/emu/video]pc_vga.c

trunk/src/emu/video/pc_vga.c
r17520r17521
204204   UINT8 reg_lock2;
205205   UINT8 enable_8514;
206206   UINT16 current_cmd;
207   UINT16 dest_x;
208   UINT16 dest_y;
209   UINT16 curr_x;
210   UINT16 curr_y;
207   INT16 dest_x;
208   INT16 dest_y;
209   INT16 curr_x;
210   INT16 curr_y;
211211   UINT16 line_axial_step;
212212   UINT16 line_diagonal_step;
213213   UINT16 rect_width;
r17520r17521
215215   UINT32 fgcolour;
216216   UINT32 bgcolour;
217217   UINT32 pixel_xfer;
218   UINT16 wait_rect_x;
219   UINT16 wait_rect_y;
218   INT16 wait_rect_x;
219   INT16 wait_rect_y;
220220   UINT8 bus_size;
221221   UINT8 multifunc_sel;
222222   bool gpbusy;
r17520r17521
28512851      switch(data & 0xe000)
28522852      {
28532853      case 0x0000:  // NOP (for "Short Stroke Vectors")
2854         s3.state = S3_IDLE;
28542855         s3.gpbusy = false;
28552856         logerror("S3: Command (%04x) - NOP\n",s3.current_cmd);
28562857         break;
28572858      case 0x2000:  // Line
2859         s3.state = S3_IDLE;
28582860         s3.gpbusy = false;
28592861         logerror("S3: Command (%04x) - Line\n",s3.current_cmd);
28602862         break;
r17520r17521
28662868            s3.wait_rect_x = s3.curr_x;
28672869            s3.wait_rect_y = s3.curr_y;
28682870            s3.bus_size = (data & 0x0600) >> 9;
2871            logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,s3.curr_x,
2872                  s3.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
28692873            break;
28702874         }
28712875         offset = VGA_START_ADDRESS;
28722876         offset += (VGA_LINE_LENGTH * s3.curr_y);
28732877         offset += s3.curr_x;
2874         dir_x = 2;
2878         if(data & 0x0020)
2879            dir_x = 2;
2880         else
2881            dir_x -= 2;
28752882         for(y=0;y<=s3.rect_height;y++)
28762883         {
28772884            for(x=0;x<=s3.rect_width;x+=dir_x)
r17520r17521
28792886               vga.memory[(offset+x) % vga.svga_intf.vram_size] = s3.fgcolour & 0x000000ff;
28802887               vga.memory[(offset+x+1) % vga.svga_intf.vram_size] = (s3.fgcolour & 0x0000ff00) >> 8;
28812888            }
2882            offset += VGA_LINE_LENGTH;
2889            if(data & 0x0080)
2890               offset += VGA_LINE_LENGTH;
2891            else
2892               offset -= VGA_LINE_LENGTH;
28832893         }
2894         s3.state = S3_IDLE;
28842895         s3.gpbusy = false;
28852896         logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,s3.curr_x,
28862897               s3.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour);
r17520r17521
28912902         offset += s3.dest_x;
28922903         src = VGA_START_ADDRESS;
28932904         src += (VGA_LINE_LENGTH * s3.curr_y);
2894         src += s3.curr_x;
2905         if(s3.curr_x & 0x0800)
2906            src -= s3.curr_x & 0x7ff;
2907         else
2908            src += s3.curr_x;
28952909         buffer = (UINT8*)malloc((s3.rect_height+1)*(s3.rect_width+1));
28962910         count = 0;
28972911         // copy to temporary buffer
r17520r17521
29262940               offset -= VGA_LINE_LENGTH;
29272941         }
29282942         free(buffer);
2943         s3.state = S3_IDLE;
29292944         s3.gpbusy = false;
29302945         logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",s3.current_cmd,
29312946               s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
29322947         break;
29332948      case 0xe000:  // Pattern Fill
2949         s3.state = S3_IDLE;
29342950         s3.gpbusy = false;
29352951         logerror("S3: Command (%04x) - Pattern Fill\n",s3.current_cmd);
29362952         break;
29372953      default:
2954         s3.state = S3_IDLE;
29382955         s3.gpbusy = false;
29392956         logerror("S3: Unknown command: %04x\n",data);
29402957      }
r17520r17521
29632980WRITE16_HANDLER( s3_8ae8_w )
29642981{
29652982   s3.line_axial_step = data & 0x3fff;
2966   s3.dest_y = data & 0x0fff;
2983   s3.dest_y = data;
29672984   logerror("S3: Line Axial Step / Destination Y write %04x\n",data);
29682985}
29692986
r17520r17521
29883005WRITE16_HANDLER( s3_8ee8_w )
29893006{
29903007   s3.line_diagonal_step = data & 0x3fff;
2991   s3.dest_x = data & 0x0fff;
3008   s3.dest_x = data;
29923009   logerror("S3: Line Diagonal Step / Destination X write %04x\n",data);
29933010}
29943011
r17520r17521
30193036
30203037WRITE16_HANDLER(s3_currentx_w)
30213038{
3022   s3.curr_x = data & 0x0fff;
3023   logerror("S3: Current X set to %04x\n",data);
3039   s3.curr_x = data;
3040   logerror("S3: Current X set to %04x (%i)\n",data,s3.curr_x);
30243041}
30253042
30263043READ16_HANDLER(s3_currenty_r)
r17520r17521
30303047
30313048WRITE16_HANDLER(s3_currenty_w)
30323049{
3033   s3.curr_y = data & 0x0fff;
3034   logerror("S3: Current Y set to %04x\n",data);
3050   s3.curr_y = data;
3051   logerror("S3: Current Y set to %04x (%i)\n",data,s3.curr_y);
30353052}
30363053
30373054READ16_HANDLER(s3_fgcolour_r)
r17520r17521
31043121   case 0xf000:
31053122      s3.multifunc_sel = data & 0x000f;
31063123   default:
3107      logerror("S3: Unimplemented multifunction register %i write\n",data >> 12);
3124      logerror("S3: Unimplemented multifunction register %i write %03x\n",data >> 12,data & 0x0fff);
31083125   }
31093126}
31103127
r17520r17521
31403157      off += s3.wait_rect_x;
31413158      for(x=0;x<data_size;x++)
31423159      {
3143         if(s3.current_cmd & 0x1000)
3160         if(s3.wait_rect_x >= 0 || s3.wait_rect_y >= 0)
31443161         {
3145            xfer = ((s3.pixel_xfer & 0x000000ff) << 8) | ((s3.pixel_xfer & 0x0000ff00) >> 8)
3146                | ((s3.pixel_xfer & 0x00ff0000) << 8) | ((s3.pixel_xfer & 0xff000000) >> 8);
3162            if(s3.current_cmd & 0x1000)
3163            {
3164               xfer = ((s3.pixel_xfer & 0x000000ff) << 8) | ((s3.pixel_xfer & 0x0000ff00) >> 8)
3165                   | ((s3.pixel_xfer & 0x00ff0000) << 8) | ((s3.pixel_xfer & 0xff000000) >> 8);
3166            }
3167            else
3168               xfer = s3.pixel_xfer;
3169            if((xfer & ((1<<(data_size-1))>>x)) != 0)
3170               vga.memory[off] = s3.fgcolour & 0x00ff;
31473171         }
3148         else
3149            xfer = s3.pixel_xfer;
3150         if((xfer & ((1<<(data_size-1))>>x)) != 0)
3151            vga.memory[off] = s3.fgcolour & 0x00ff;
31523172         off++;
31533173         s3.wait_rect_x++;
31543174         if(s3.wait_rect_x > s3.curr_x + s3.rect_width)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team