Previous 15994 Revisions Next

r2084 Monday 24th March, 2008 at 10:10:15 UTC by Wilbert Pol
pc_cga: Adding some documentation. All video modes now set the correct number of pixels per 6845 column.
[src/mess/video]pc_cga.c

src/mess/video/pc_cga.c
r2083r2084
510510
511511   if ( y == 0 ) logerror("cga_gfx_1bpp_update_row\n");
512512   for ( i = 0; i < x_count; i++ ) {
513      UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 );
513      UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 );
514514      UINT8 data = videoram[ offset ];
515515
516516      *p = ( data & 0x80 ) ? fg : 0; p++;
r2083r2084
583583
584584/*
585585 *   rW   CGA mode control register (see #P138)
586 *
587 *  x x x 0 1 0 0 0 - 320x200, 40x25 text. Colour on RGB and composite monitors.
588 *  x x x 0 1 0 0 1 - 640x200, 80x25 text. Colour on RGB and composite monitors.
589 *  x x x 0 1 0 1 0 - 320x200 graphics. Colour on RGB and composite monitors.
590 *  x x x 0 1 0 1 1 - unknown/invalid.
591 *  x x x 0 1 1 0 0 - 320x200, 40x25 text. Colour on RGB, greyscale on composite monitors.
592 *  x x x 0 1 1 0 1 - 640x200, 80x25 text. Colour on RGB, greyscale on composite monitors.
593 *  x x x 0 1 1 1 0 - 320x200 graphics. Alternative palette on RGB, greyscale on composite monitors.
594 *  x x x 0 1 1 1 1 - unknown/invalid.
595 *  x x x 1 1 0 0 0 - unknown/invalid.
596 *  x x x 1 1 0 0 1 - unknown/invalid.
597 *  x x x 1 1 0 1 0 - 160x200/640x200 graphics. 640x200 on RGB monitor, 160x200 on composite monitor.
598 *  x x x 1 1 0 1 1 - unknown/invalid.
599 *  x x x 1 1 1 0 0 - unknown/invalid.
600 *  x x x 1 1 1 0 1 - unknown/invalid.
601 *  x x x 1 1 1 1 0 - 640x200 graphics. Colour on black on RGB monitor, monochrome on composite monitor.
602 *  x x x 1 1 1 1 1 - unknown/invalid.
586603 */
587static void pc_cga_mode_control_w(int data)
604static void pc_cga_mode_control_w(running_machine *machine, int data)
588605{
606   device_config   *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, CGA_MC6845_NAME);
589607   unsigned char mask = 0x3B;
590608
591609   CGA_LOG(1,"CGA_mode_control_w",("$%02x: columns %d, gfx %d, hires %d, blink %d\n",
r2083r2084
599617   //logerror("mode set to %02X\n", cga.mode_control & 0x3F );
600618   switch ( cga.mode_control & 0x3F ) {
601619   case 0x08: case 0x09: case 0x0C: case 0x0D:
620      mc6845_set_hpixels_per_column( devconf, 8 );
602621      cga.update_row = cga_text_inten_update_row;
603622      break;
604623   case 0x0A: case 0x0B: case 0x2A: case 0x2B:
624      mc6845_set_hpixels_per_column( devconf, 8 );
605625      if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) {
606626         cga.update_row = cga_gfx_4bppl_update_row;
607627      } else {
r2083r2084
609629      }
610630      break;
611631   case 0x0E: case 0x0F: case 0x2E: case 0x2F:
632      mc6845_set_hpixels_per_column( devconf, 8 );
612633      cga.update_row = cga_gfx_2bpp_update_row;
613634      break;
614635   case 0x18: case 0x19: case 0x1C: case 0x1D:
636      mc6845_set_hpixels_per_column( devconf, 8 );
615637      cga.update_row = cga_text_inten_alt_update_row;
616638      break;
617639   case 0x1A: case 0x1B: case 0x3A: case 0x3B:
640      mc6845_set_hpixels_per_column( devconf, 8 );
618641      if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) {
619642         cga.update_row = cga_gfx_4bpph_update_row;
620643      } else {
r2083r2084
622645      }
623646      break;
624647   case 0x1E: case 0x1F: case 0x3E: case 0x3F:
648      mc6845_set_hpixels_per_column( devconf, 16 );
625649      cga.update_row = cga_gfx_1bpp_update_row;
626650      break;
627651   case 0x28: case 0x29: case 0x2C: case 0x2D:
652      mc6845_set_hpixels_per_column( devconf, 8 );
628653      cga.update_row = cga_text_blink_update_row;
629654      break;
630655   case 0x38: case 0x39: case 0x3C: case 0x3D:
656      mc6845_set_hpixels_per_column( devconf, 8 );
631657      cga.update_row = cga_text_blink_alt_update_row;
632658      break;
633659   default:
r2083r2084
711737      mc6845_register_w( devconf, offset, data );
712738      break;
713739   case 8:
714      pc_cga_mode_control_w(data);
740      pc_cga_mode_control_w(machine, data);
715741      break;
716742   case 9:
717743      pc_cga_color_select_w(data);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team