Previous 199869 Revisions Next

r17550 Wednesday 29th August, 2012 at 01:23:11 UTC by Barry Rodewald
(MESS) svga_s3: Fixed text rendering when full acceleration is set in win95. (no whatsnew)
[src/emu/video]pc_vga.c

trunk/src/emu/video/pc_vga.c
r17549r17550
30053005{
30063006   if(s3.enable_8514 != 0)
30073007   {
3008      int x,y,count;
3008      int x,y;
30093009      int dir_x;
3010//      int pattern_x,pattern_y;
30103011      UINT32 offset,src;
3011      UINT8* buffer;  // for bitblt operations
30123012
30133013      s3.current_cmd = data;
30143014      switch(data & 0xe000)
r17549r17550
30643064         offset += s3.dest_x;
30653065         src = VGA_START_ADDRESS;
30663066         src += (VGA_LINE_LENGTH * s3.curr_y);
3067         if(s3.curr_x & 0x0800)
3068            src -= s3.curr_x & 0x7ff;
3069         else
3070            src += s3.curr_x;
3071         buffer = (UINT8*)malloc((s3.rect_height+1)*(s3.rect_width+1));
3072         count = 0;
3073         // copy to temporary buffer
3067         src += s3.curr_x;
30743068         for(y=0;y<=s3.rect_height;y++)
30753069         {
30763070            for(x=0;x<=s3.rect_width;x++)
30773071            {
30783072               if(data & 0x0020)
3079                  buffer[count++] = vga.memory[(src+x) % vga.svga_intf.vram_size];
3073                  vga.memory[(offset+x) % vga.svga_intf.vram_size] = vga.memory[(src+x) % vga.svga_intf.vram_size];
30803074               else
3081                  buffer[count++] = vga.memory[(src-x) % vga.svga_intf.vram_size];
3075                  vga.memory[(offset-x) % vga.svga_intf.vram_size] = vga.memory[(src-x) % vga.svga_intf.vram_size];
30823076            }
30833077            if(data & 0x0080)
3078            {
30843079               src += VGA_LINE_LENGTH;
3080               offset += VGA_LINE_LENGTH;
3081            }
30853082            else
3083            {
30863084               src -= VGA_LINE_LENGTH;
3087         }
3088         // write from buffer to screen
3089         count = 0;
3090         for(y=0;y<=s3.rect_height;y++)
3091         {
3092            for(x=0;x<=s3.rect_width;x++)
3093            {
3094               if(data & 0x0020)
3095                  vga.memory[(offset+x) % vga.svga_intf.vram_size] = buffer[count++];
3096               else
3097                  vga.memory[(offset-x) % vga.svga_intf.vram_size] = buffer[count++];
3085               offset -= VGA_LINE_LENGTH;
30983086            }
3099            if(data & 0x0080)
3100               offset += VGA_LINE_LENGTH;
3101            else
3102               offset -= VGA_LINE_LENGTH;
31033087         }
3104         free(buffer);
31053088         s3.state = S3_IDLE;
31063089         s3.gpbusy = false;
31073090         logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",s3.current_cmd,
31083091               s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
31093092         break;
31103093      case 0xe000:  // Pattern Fill
3094//         offset = VGA_START_ADDRESS;
3095//         offset += (VGA_LINE_LENGTH * s3.dest_y);
3096//         offset += s3.dest_x;
3097//         src = VGA_START_ADDRESS;
3098//         src += (VGA_LINE_LENGTH * s3.curr_y);
3099//         src += s3.curr_x;
3100//         pattern_x = pattern_y = 0;
3101//         for(y=0;y<=s3.rect_height;y++)
3102//         {
3103//            for(x=0;x<=s3.rect_width;x++)
3104//            {
3105//               if(data & 0x0020)
3106//                  vga.memory[(offset+x) % vga.svga_intf.vram_size] = vga.memory[(src+pattern_x) % vga.svga_intf.vram_size];
3107//               else
3108//                  vga.memory[(offset-x) % vga.svga_intf.vram_size] = vga.memory[(src-pattern_x) % vga.svga_intf.vram_size];
3109//               pattern_x++;
3110//               pattern_x %= 8;
3111//            }
3112//            pattern_y++;
3113//            src += VGA_LINE_LENGTH;
3114//            if(pattern_y % 8 == 0)
3115//               src -= (VGA_LINE_LENGTH * 8);  // move src pointer back to top of pattern
3116//            if(data & 0x0080)
3117//               offset += VGA_LINE_LENGTH;
3118//            else
3119//               offset -= VGA_LINE_LENGTH;
3120//         }
31113121         s3.state = S3_IDLE;
31123122         s3.gpbusy = false;
3113         logerror("S3: Command (%04x) - Pattern Fill\n",s3.current_cmd);
3123         logerror("S3: Command (%04x) - Pattern Fill - source %i,%i  dest %i,%i  Width: %i Height: %i\n",s3.current_cmd,
3124               s3.curr_x,s3.curr_y,s3.dest_x,s3.dest_y,s3.rect_width,s3.rect_height);
31143125         break;
31153126      default:
31163127         s3.state = S3_IDLE;
r17549r17550
33373348   int x,data_size = 0;
33383349   UINT32 off,xfer = 0;
33393350
3340   // the data in the pixel transfer register masks the rectangle output(?)
3351   // the data in the pixel transfer register or written to VRAM masks the rectangle output
33413352   if(s3.bus_size == 0)  // 8-bit
33423353      data_size = 8;
33433354   if(s3.bus_size == 1)  // 16-bit
r17549r17550
33543365         // check clipping rectangle
33553366         if(s3.wait_rect_x >= s3.scissors_left && s3.wait_rect_x <= s3.scissors_right && s3.wait_rect_y >= s3.scissors_top && s3.wait_rect_y <= s3.scissors_bottom)
33563367         {
3357            if(s3.current_cmd & 0x1000)
3368            if((s3.current_cmd & 0x1000) && (data_size != 8))
33583369            {
33593370               xfer = ((s3.pixel_xfer & 0x000000ff) << 8) | ((s3.pixel_xfer & 0x0000ff00) >> 8)
33603371                   | ((s3.pixel_xfer & 0x00ff0000) << 8) | ((s3.pixel_xfer & 0xff000000) >> 8);
r17549r17550
33783389            s3.state = S3_IDLE;
33793390            s3.gpbusy = false;
33803391         }
3392         return;
33813393      }
33823394   }
33833395}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team