Previous 15994 Revisions Next

r13997 Thursday 12th January, 2012 at 22:10:26 UTC by Angelo Salese
Part 2 of refactoring (preps for partial updates)
[src/emu/video]pc_vga.c

src/emu/video/pc_vga.c
r13996r13997
5454
5555   UINT8 *memory;
5656   UINT8 *fontdirty;
57   UINT16 pens[16]; /* the current 16 pens */
57   UINT32 pens[16]; /* the current 16 pens */
5858
5959   UINT8 miscellaneous_output;
6060   UINT8 feature_control;
r13996r13997
184184   pc_current_width = -1;
185185}
186186
187static void vga_vh_text(bitmap_ind16 &bitmap, const rectangle &cliprect)
187static void vga_vh_text(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
188188{
189189   UINT8 ch, attr;
190190   UINT8 bits;
191191   UINT8 *font;
192   UINT16 *bitmapline;
192   UINT32 *bitmapline;
193193   int width=CHAR_WIDTH, height=CRTC_CHAR_HEIGHT;
194194   int pos, line, column, mask, w, h, addr;
195195   pen_t pen;
r13996r13997
214214
215215         for (h = MAX(-line, 0); (h < height) && (line+h < MIN(TEXT_LINES, bitmap.height())); h++)
216216         {
217            bitmapline = &bitmap.pix16(line+h);
217            bitmapline = &bitmap.pix32(line+h);
218218            bits = font[h<<2];
219219
220220            assert(bitmapline);
r13996r13997
251251   }
252252}
253253
254static void vga_vh_ega(bitmap_ind16 &bitmap,  const rectangle &cliprect)
254static void vga_vh_ega(running_machine &machine, bitmap_rgb32 &bitmap,  const rectangle &cliprect)
255255{
256256   int pos, line, column, c, addr, i;
257257   int height = CRTC_CHAR_HEIGHT;
258   UINT16 *bitmapline;
259   UINT16 *newbitmapline;
258   UINT32 *bitmapline;
259   UINT32 *newbitmapline;
260260   pen_t pen;
261261
262262   for (addr=EGA_START_ADDRESS, pos=0, line=0; line<LINES;
263263       line += height, addr=(addr+EGA_LINE_LENGTH)&0x3ffff)
264264   {
265      bitmapline = &bitmap.pix16(line);
265      bitmapline = &bitmap.pix32(line);
266266
267267      for (pos=addr, c=0, column=0; column<EGA_COLUMNS; column++, c+=8, pos=(pos+4)&0x3ffff)
268268      {
r13996r13997
290290         if (line + i >= LINES)
291291            break;
292292
293         newbitmapline = &bitmap.pix16(line+i);
293         newbitmapline = &bitmap.pix32(line+i);
294294         memcpy(newbitmapline, bitmapline, EGA_COLUMNS * 8 * sizeof(UINT16));
295295      }
296296   }
297297}
298298
299static void vga_vh_vga(bitmap_ind16 &bitmap, const rectangle &cliprect)
299static void vga_vh_vga(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
300300{
301301   int pos, line, column, c, addr, curr_addr;
302   UINT16 *bitmapline;
302   UINT32 *bitmapline;
303303   UINT16 mask_comp;
304304
305305   /* line compare is screen sensitive */
r13996r13997
314314            curr_addr = addr;
315315         if(line == (vga.line_compare & mask_comp))
316316            curr_addr = 0;
317         bitmapline = &bitmap.pix16(line);
317         bitmapline = &bitmap.pix32(line);
318318         addr %= vga.svga_intf.vram_size;
319319         for (pos=curr_addr, c=0, column=0; column<VGA_COLUMNS; column++, c+=8, pos+=0x20)
320320         {
r13996r13997
339339            curr_addr = addr;
340340         if(line == (vga.line_compare & mask_comp))
341341            curr_addr = 0;
342         bitmapline = &bitmap.pix16(line);
342         bitmapline = &bitmap.pix32(line);
343343         addr %= vga.svga_intf.vram_size;
344344         for (pos=curr_addr, c=0, column=0; column<VGA_COLUMNS; column++, c+=8, pos+=0x08)
345345         {
r13996r13997
422422   return 0;
423423}
424424
425SCREEN_UPDATE_IND16( pc_video )
425SCREEN_UPDATE_RGB32( pc_video )
426426{
427427   UINT8 cur_mode = 0;
428428   int w = 0, h = 0;
r13996r13997
451451   switch(cur_mode)
452452   {
453453      case 0: bitmap.fill(get_black_pen(screen.machine()), cliprect);break;
454      case 1: vga_vh_text(bitmap,cliprect); break;
455      case 2: vga_vh_vga(bitmap,cliprect); break;
456      case 3: vga_vh_ega(bitmap,cliprect); break;
454      case 1: vga_vh_text(screen.machine(), bitmap,cliprect); break;
455      case 2: vga_vh_vga (screen.machine(), bitmap,cliprect); break;
456      case 3: vga_vh_ega (screen.machine(), bitmap,cliprect); break;
457457      /* Nothing uses this so far, to be nuked */
458458      case 4: vga.svga_intf.choosevideomode(vga.sequencer.data, vga.crtc.data, vga.gc.data, &w, &h); break;
459459   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team