Previous 15994 Revisions Next

r13779 Thursday 29th December, 2011 at 11:55:19 UTC by Angelo Salese
Preliminary pixel clock for VGA
[src/emu/video]pc_vga.c

src/emu/video/pc_vga.c
r13778r13779
1616    ega/vga
1717    64k (early ega 16k) words of 32 bit memory
1818
19   TODO:
20   - modernize
21   - convert to a device.
22   - fix pixel clock
23   - add emulated mc6845 hook-up
24   - fix resolution change
25   - fix video update.
26   - (and many more ...)
1927
2028    ROM declarations:
2129
r13778r13779
525533   case 0xa:
526534      vga.attribute.state = 0;
527535      data = 0;/*4; */
528#if 0 /* slow */
529      {
530         int clock=vga.monitor.get_clock();
531         int lines=vga.monitor.get_lines();
532         int columns=vga.monitor.get_columns();
533         int diff = (((space->machine().time() - vga.monitor.start_time) * clock).seconds)
534            %(lines*columns);
535         if (diff<columns*vga.monitor.get_sync_lines()) data|=8;
536         diff=diff/lines;
537         if (diff%columns<vga.monitor.get_sync_columns()) data|=1;
538      }
539#elif 1
540      if (vga.monitor.retrace)
541      {
542         data |= 1;
543         if ((space->machine().time() - vga.monitor.start_time) > attotime::from_usec(300))
544         {
545            data |= 8;
546            vga.monitor.retrace=0;
547         }
548      }
549      else
550      {
551         if ((space->machine().time() - vga.monitor.start_time)  > attotime::from_msec(15))
552            vga.monitor.retrace=1;
553         vga.monitor.start_time=space->machine().time();
554      }
555#else
556      // not working with ps2m30
557      if (vga.monitor.retrace) data|=9;
558      vga.monitor.retrace=0;
559#endif
536      data |= (space->machine().primary_screen->hblank() & 1) << 0;
537      data |= (space->machine().primary_screen->vblank() & 1) << 3;
560538      /* ega diagnostic readback enough for oak bios */
561539      switch (vga.attribute.data[0x12]&0x30) {
562540      case 0:
r13778r13779
998976   pc_vga_reset(machine);
999977}
1000978
1001static TIMER_CALLBACK(vga_timer)
1002{
1003   vga.monitor.retrace=1;
1004}
1005
1006979static VIDEO_START( vga )
1007980{
1008981   vga.monitor.get_clock=vga_get_clock;
r13778r13779
1010983   vga.monitor.get_columns=vga_get_crtc_columns;
1011984   vga.monitor.get_sync_lines=vga_get_crtc_sync_lines;
1012985   vga.monitor.get_sync_columns=vga_get_crtc_sync_columns;
1013   machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
1014986   pc_video_start(machine, pc_vga_choosevideomode);
1015987}
1016988
r13778r13779
12691241MACHINE_CONFIG_FRAGMENT( pcvideo_vga )
12701242   MCFG_SCREEN_ADD("screen", RASTER)
12711243   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1272   MCFG_SCREEN_SIZE(720, 480)
1273   MCFG_SCREEN_VISIBLE_AREA(0,720-1, 0,480-1)
1244   MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,800,0,640,525,0,480)
12741245   MCFG_SCREEN_UPDATE(pc_video)
1275   MCFG_SCREEN_REFRESH_RATE(60)
1276   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
12771246
12781247   MCFG_PALETTE_LENGTH(0x100)
12791248   MCFG_PALETTE_INIT(vga)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team