src/mess/video/pc_cga.c
| r2162 | r2163 | |
| 73 | 73 | extern const unsigned char cga_palette[16 * CGA_PALETTE_SETS][3]; |
| 74 | 74 | |
| 75 | 75 | |
| 76 | INPUT_PORTS_START( pcvideo_cga ) |
| 77 | PORT_START_TAG( "pcvideo_cga_config" ) |
| 78 | PORT_CONFNAME( 0x03, 0x00, "CGA character set") |
| 79 | PORT_CONFSETTING(0x00, DEF_STR( Normal )) |
| 80 | PORT_CONFSETTING(0x01, "Alternative") |
| 81 | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 82 | PORT_CONFSETTING(0x00, "Colour RGB") |
| 83 | PORT_CONFSETTING(0x04, "Mono RGB") |
| 84 | PORT_CONFSETTING(0x08, "Colour composite") |
| 85 | PORT_CONFSETTING(0x0C, "Television") |
| 86 | PORT_CONFSETTING(0x10, "LCD") |
| 87 | PORT_CONFNAME( 0xE0, 0x00, "CGA chipset") |
| 88 | PORT_CONFSETTING(0x00, "IBM") |
| 89 | PORT_CONFSETTING(0x20, "Amstrad PC1512") |
| 90 | PORT_CONFSETTING(0x40, "Amstrad PPC512") |
| 91 | PORT_CONFSETTING(0x60, "ATI") |
| 92 | PORT_CONFSETTING(0x80, "Paradise") |
| 93 | INPUT_PORTS_END |
| 94 | |
| 95 | |
| 96 | INPUT_PORTS_START( pcvideo_cga_at ) |
| 97 | PORT_START_TAG( "pcvideo_cga_config" ) |
| 98 | PORT_BIT( 0x03, 0x01, IPT_UNUSED ) /* Always use fat characters */ |
| 99 | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 100 | PORT_CONFSETTING(0x00, "Colour RGB") |
| 101 | PORT_CONFSETTING(0x04, "Mono RGB") |
| 102 | PORT_CONFSETTING(0x08, "Colour composite") |
| 103 | PORT_CONFSETTING(0x0C, "Television") |
| 104 | PORT_CONFSETTING(0x10, "LCD") |
| 105 | PORT_CONFNAME( 0xE0, 0x00, "CGA chipset") |
| 106 | PORT_CONFSETTING(0x00, "IBM") |
| 107 | PORT_CONFSETTING(0x20, "Amstrad PC1512") |
| 108 | PORT_CONFSETTING(0x40, "Amstrad PPC512") |
| 109 | PORT_CONFSETTING(0x60, "ATI") |
| 110 | PORT_CONFSETTING(0x80, "Paradise") |
| 111 | INPUT_PORTS_END |
| 112 | |
| 113 | |
| 114 | INPUT_PORTS_START( pcvideo_pc1512 ) |
| 115 | PORT_START_TAG( "pcvideo_cga_config" ) |
| 116 | PORT_CONFNAME( 0x03, 0x03, "CGA character set") |
| 117 | PORT_CONFSETTING(0x00, "Greek") |
| 118 | PORT_CONFSETTING(0x01, "Danish 2") |
| 119 | PORT_CONFSETTING(0x02, "Danish 1") |
| 120 | PORT_CONFSETTING(0x03, "Default") |
| 121 | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 122 | PORT_CONFSETTING(0x00, "Colour RGB") |
| 123 | PORT_CONFSETTING(0x04, "Mono RGB") |
| 124 | PORT_BIT ( 0xE0, 0x20, IPT_UNUSED ) /* Chipset is always PC1512 */ |
| 125 | INPUT_PORTS_END |
| 126 | |
| 127 | /* Dipswitch for font selection */ |
| 128 | #define CGA_FONT (readinputport(cga.config_input_port)&3) |
| 129 | |
| 130 | /* Dipswitch for monitor selection */ |
| 131 | #define CGA_MONITOR (readinputport(cga.config_input_port)&0x1C) |
| 132 | #define CGA_MONITOR_RGB 0x00 /* Colour RGB */ |
| 133 | #define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */ |
| 134 | #define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */ |
| 135 | #define CGA_MONITOR_TELEVISION 0x0C /* Television */ |
| 136 | #define CGA_MONITOR_LCD 0x10 /* LCD, eg PPC512 */ |
| 137 | |
| 138 | |
| 139 | /* Dipswitch for chipset selection */ |
| 140 | #define CGA_CHIPSET (readinputport(cga.config_input_port)&0xE0) |
| 141 | #define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */ |
| 142 | #define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */ |
| 143 | #define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */ |
| 144 | #define CGA_CHIPSET_ATI 0x60 /* ATI (supports Plantronics) */ |
| 145 | #define CGA_CHIPSET_PARADISE 0x80 /* Paradise (used in PC1640) */ |
| 146 | |
| 147 | |
| 76 | 148 | static VIDEO_UPDATE( mc6845_cga ); |
| 77 | 149 | static READ8_HANDLER( pc_cga8_r ); |
| 78 | 150 | static WRITE8_HANDLER( pc_cga8_w ); |
| r2162 | r2163 | |
| 140 | 212 | |
| 141 | 213 | UINT8 *chr_gen; |
| 142 | 214 | |
| 215 | int config_input_port; |
| 216 | |
| 143 | 217 | mc6845_update_row_func update_row; |
| 144 | 218 | UINT8 palette_lut_2bpp[4]; |
| 145 | 219 | UINT8 vsync; |
| r2162 | r2163 | |
| 326 | 400 | } |
| 327 | 401 | |
| 328 | 402 | |
| 329 | | void pcvideo_cga_set_character_base( UINT8 *character_base ) { |
| 330 | | cga.chr_gen = character_base; |
| 331 | | } |
| 332 | | |
| 333 | | |
| 334 | 403 | static int internal_pc_cga_video_start(int personality) |
| 335 | 404 | { |
| 336 | 405 | memset(&cga, 0, sizeof(cga)); |
| 337 | 406 | cga.update_row = NULL; |
| 338 | 407 | |
| 408 | cga.chr_gen = memory_region( REGION_GFX1 ) + 0x1000; |
| 409 | |
| 339 | 410 | state_save_register_item("pccga", 0, cga.mode_control); |
| 340 | 411 | state_save_register_item("pccga", 0, cga.color_select); |
| 341 | 412 | state_save_register_item("pccga", 0, cga.status); |
| 342 | 413 | state_save_register_item("pccga", 0, cga.plantronics); |
| 343 | 414 | |
| 415 | cga.config_input_port = port_tag_to_index( "pcvideo_cga_config" ); |
| 416 | |
| 344 | 417 | return 0; |
| 345 | 418 | } |
| 346 | 419 | |
| r2162 | r2163 | |
| 399 | 472 | static VIDEO_UPDATE( mc6845_cga ) { |
| 400 | 473 | device_config *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 401 | 474 | mc6845_update( devconf, bitmap, cliprect); |
| 475 | |
| 476 | /* Check for changes in font dipsetting */ |
| 477 | switch ( CGA_FONT & 0x01 ) { |
| 478 | case 0: |
| 479 | cga.chr_gen = memory_region(REGION_GFX1) + 0x1800; |
| 480 | break; |
| 481 | case 1: |
| 482 | cga.chr_gen = memory_region(REGION_GFX1) + 0x1000; |
| 483 | break; |
| 484 | } |
| 402 | 485 | return 0; |
| 403 | 486 | } |
| 404 | 487 | |
| r2162 | r2163 | |
| 1418 | 1501 | static VIDEO_UPDATE( mc6845_pc1512 ) { |
| 1419 | 1502 | device_config *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1420 | 1503 | mc6845_update( devconf, bitmap, cliprect); |
| 1504 | |
| 1505 | /* Check for changes in font dipsetting */ |
| 1506 | switch ( CGA_FONT & 0x03 ) { |
| 1507 | case 0: |
| 1508 | cga.chr_gen = memory_region(REGION_GFX1) + 0x0000; |
| 1509 | break; |
| 1510 | case 1: |
| 1511 | cga.chr_gen = memory_region(REGION_GFX1) + 0x0800; |
| 1512 | break; |
| 1513 | case 2: |
| 1514 | cga.chr_gen = memory_region(REGION_GFX1) + 0x1000; |
| 1515 | break; |
| 1516 | case 3: |
| 1517 | cga.chr_gen = memory_region(REGION_GFX1) + 0x1800; |
| 1518 | break; |
| 1519 | } |
| 1520 | |
| 1421 | 1521 | return 0; |
| 1422 | 1522 | } |
| 1423 | 1523 | |
src/mess/video/pc_cga.h
| r2162 | r2163 | |
| 11 | 11 | extern const unsigned char cga_palette[CGA_PALETTE_SETS * 16][3]; |
| 12 | 12 | |
| 13 | 13 | MACHINE_DRIVER_EXTERN( pcvideo_cga ); |
| 14 | INPUT_PORTS_EXTERN( pcvideo_cga ); |
| 15 | INPUT_PORTS_EXTERN( pcvideo_cga_at ); |
| 14 | 16 | |
| 15 | | /* Set the base address for the character generation */ |
| 16 | | void pcvideo_cga_set_character_base( UINT8 *character_base ); |
| 17 | | |
| 18 | 17 | /* has a special 640x200 in 16 color mode, 4 banks at 0xb8000 */ |
| 19 | 18 | MACHINE_DRIVER_EXTERN( pcvideo_pc1512 ); |
| 19 | INPUT_PORTS_EXTERN( pcvideo_pc1512 ); |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | /* Used in machine/pc.c */ |
| r2162 | r2163 | |
| 25 | 25 | WRITE16_HANDLER( pc1512_videoram16le_w ); |
| 26 | 26 | |
| 27 | 27 | |
| 28 | | /* Dipswitch for monitor selection */ |
| 29 | | #define CGA_MONITOR (readinputport(20)&0x1C) |
| 30 | | #define CGA_MONITOR_RGB 0x00 /* Colour RGB */ |
| 31 | | #define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */ |
| 32 | | #define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */ |
| 33 | | #define CGA_MONITOR_TELEVISION 0x0C /* Television */ |
| 34 | | #define CGA_MONITOR_LCD 0x10 /* LCD, eg PPC512 */ |
| 35 | | |
| 36 | | /* Dipswitch for chipset selection */ |
| 37 | | #define CGA_CHIPSET (readinputport(20)&0xE0) |
| 38 | | #define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */ |
| 39 | | #define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */ |
| 40 | | #define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */ |
| 41 | | #define CGA_CHIPSET_ATI 0x60 /* ATI (supports Plantronics) */ |
| 42 | | #define CGA_CHIPSET_PARADISE 0x80 /* Paradise (used in PC1640) */ |
| 43 | | |
src/mess/drivers/pc.c
| r2162 | r2163 | |
| 493 | 493 | PORT_INCLUDE( pc_keyboard ) /* IN4 - IN11 */ |
| 494 | 494 | PORT_INCLUDE( pc_mouse_microsoft ) /* IN12 - IN14 */ |
| 495 | 495 | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 496 | | |
| 497 | | PORT_START /* IN20 */ |
| 498 | | PORT_CONFNAME( 0x03, 0x00, "CGA character set") |
| 499 | | PORT_CONFSETTING(0x00, DEF_STR( Normal )) |
| 500 | | PORT_CONFSETTING(0x01, "Alternative") |
| 501 | | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 502 | | PORT_CONFSETTING(0x00, "Colour RGB") |
| 503 | | PORT_CONFSETTING(0x04, "Mono RGB") |
| 504 | | PORT_CONFSETTING(0x08, "Colour composite") |
| 505 | | PORT_CONFSETTING(0x0C, "Television") |
| 506 | | PORT_CONFSETTING(0x10, "LCD") |
| 507 | | PORT_CONFNAME( 0xE0, 0x00, "CGA chipset") |
| 508 | | PORT_CONFSETTING(0x00, "IBM") |
| 509 | | PORT_CONFSETTING(0x20, "Amstrad PC1512") |
| 510 | | PORT_CONFSETTING(0x40, "Amstrad PPC512") |
| 511 | | PORT_CONFSETTING(0x60, "ATI") |
| 512 | | PORT_CONFSETTING(0x80, "Paradise") |
| 496 | PORT_INCLUDE( pcvideo_cga ) |
| 513 | 497 | INPUT_PORTS_END |
| 514 | 498 | |
| 515 | 499 | static INPUT_PORTS_START( europc ) |
| r2162 | r2163 | |
| 720 | 704 | PORT_INCLUDE( pc_keyboard ) /* IN4 - IN11 */ |
| 721 | 705 | PORT_INCLUDE( pc_mouse_microsoft ) /* IN12 - IN14 */ |
| 722 | 706 | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 723 | | |
| 724 | | PORT_START /* IN20 */ |
| 725 | | PORT_CONFNAME( 0x03, 0x00, "CGA character set") |
| 726 | | PORT_CONFSETTING(0x00, DEF_STR( Normal )) |
| 727 | | PORT_CONFSETTING(0x01, "Alternative") |
| 728 | | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 729 | | PORT_CONFSETTING(0x00, "Colour RGB") |
| 730 | | PORT_CONFSETTING(0x04, "Mono RGB") |
| 731 | | PORT_CONFSETTING(0x08, "Colour composite") |
| 732 | | PORT_CONFSETTING(0x0C, "Television") |
| 733 | | PORT_CONFSETTING(0x10, "LCD") |
| 734 | | PORT_CONFNAME( 0xE0, 0x00, "CGA chipset") |
| 735 | | PORT_CONFSETTING(0x00, "IBM") |
| 736 | | PORT_CONFSETTING(0x20, "Amstrad PC1512") |
| 737 | | PORT_CONFSETTING(0x40, "Amstrad PPC512") |
| 738 | | PORT_CONFSETTING(0x60, "ATI") |
| 739 | | PORT_CONFSETTING(0x80, "Paradise") |
| 707 | PORT_INCLUDE( pcvideo_cga ) |
| 740 | 708 | INPUT_PORTS_END |
| 741 | 709 | |
| 742 | 710 | static INPUT_PORTS_START( tandy1t ) |
| r2162 | r2163 | |
| 935 | 903 | |
| 936 | 904 | PORT_INCLUDE( pc_joystick_none ) |
| 937 | 905 | |
| 938 | | PORT_START /* IN20 */ |
| 939 | | PORT_CONFNAME( 0x03, 0x03, "CGA character set") |
| 940 | | PORT_CONFSETTING(0x00, "Greek") |
| 941 | | PORT_CONFSETTING(0x01, "Danish 2") |
| 942 | | PORT_CONFSETTING(0x02, "Danish 1") |
| 943 | | PORT_CONFSETTING(0x03, "Default") |
| 944 | | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 945 | | PORT_CONFSETTING(0x00, "Colour RGB") |
| 946 | | PORT_CONFSETTING(0x04, "Mono RGB") |
| 947 | | PORT_BIT ( 0xE0, 0x20, IPT_UNUSED ) /* Chipset is always PC1512 */ |
| 906 | PORT_INCLUDE( pcvideo_pc1512 ) |
| 948 | 907 | INPUT_PORTS_END |
| 949 | 908 | |
| 950 | 909 | static INPUT_PORTS_START( pc1640 ) |