Previous 15994 Revisions Next

r2163 Sunday 30th March, 2008 at 14:49:07 UTC by Wilbert Pol
[PC_CGA] Moved cga font configuration into it's own INPUT_PORT set.
[src/mess/drivers]at.c pc.c
[src/mess/includes]pc.h
[src/mess/machine]at.c pc.c
[src/mess/video]pc_cga.c pc_cga.h

src/mess/includes/pc.h
r2162r2163
77#ifndef PC_H_
88#define PC_H_
99
10/* Dipswitch for font selection */
11#define CGA_FONT        (readinputport(20)&3)
12
1310/*----------- defined in machine/pc.c -----------*/
1411
1512DRIVER_INIT( pccga );
src/mess/video/pc_cga.c
r2162r2163
7373extern const unsigned char cga_palette[16 * CGA_PALETTE_SETS][3];
7474
7575
76INPUT_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")
93INPUT_PORTS_END
94
95
96INPUT_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")
111INPUT_PORTS_END
112
113
114INPUT_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 */
125INPUT_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
76148static VIDEO_UPDATE( mc6845_cga );
77149static READ8_HANDLER( pc_cga8_r );
78150static WRITE8_HANDLER( pc_cga8_w );
r2162r2163
140212
141213   UINT8   *chr_gen;
142214
215   int      config_input_port;
216
143217   mc6845_update_row_func   update_row;
144218   UINT8   palette_lut_2bpp[4];
145219   UINT8   vsync;
r2162r2163
326400}
327401
328402
329void pcvideo_cga_set_character_base( UINT8 *character_base ) {
330   cga.chr_gen = character_base;
331}
332
333
334403static int internal_pc_cga_video_start(int personality)
335404{
336405   memset(&cga, 0, sizeof(cga));
337406   cga.update_row = NULL;
338407
408   cga.chr_gen = memory_region( REGION_GFX1 ) + 0x1000;
409
339410   state_save_register_item("pccga", 0, cga.mode_control);
340411   state_save_register_item("pccga", 0, cga.color_select);
341412   state_save_register_item("pccga", 0, cga.status);
342413   state_save_register_item("pccga", 0, cga.plantronics);
343414
415   cga.config_input_port = port_tag_to_index( "pcvideo_cga_config" );
416
344417   return 0;
345418}
346419
r2162r2163
399472static VIDEO_UPDATE( mc6845_cga ) {
400473   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, CGA_MC6845_NAME);
401474   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   }
402485   return 0;
403486}
404487
r2162r2163
14181501static VIDEO_UPDATE( mc6845_pc1512 ) {
14191502   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, CGA_MC6845_NAME);
14201503   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
14211521   return 0;
14221522}
14231523
src/mess/video/pc_cga.h
r2162r2163
1111extern const unsigned char cga_palette[CGA_PALETTE_SETS * 16][3];
1212
1313MACHINE_DRIVER_EXTERN( pcvideo_cga );
14INPUT_PORTS_EXTERN( pcvideo_cga );
15INPUT_PORTS_EXTERN( pcvideo_cga_at );
1416
15/* Set the base address for the character generation */
16void pcvideo_cga_set_character_base( UINT8 *character_base );
17
1817/* has a special 640x200 in 16 color mode, 4 banks at 0xb8000 */
1918MACHINE_DRIVER_EXTERN( pcvideo_pc1512 );
19INPUT_PORTS_EXTERN( pcvideo_pc1512 );
2020
2121
2222/* Used in machine/pc.c */
r2162r2163
2525WRITE16_HANDLER( pc1512_videoram16le_w );
2626
2727
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/machine/at.c
r2162r2163
167167MACHINE_RESET( at )
168168{
169169   dma8237_reset();
170   pcvideo_cga_set_character_base( memory_region(REGION_GFX1) + 0x1000 );
171170}
src/mess/machine/pc.c
r2162r2163
225225}
226226
227227
228static void ibmpc_set_cga_font( void ) {
229   UINT8   *chr_gen;
230
231   /* Check for changes in font dipsetting */
232   switch ( CGA_FONT & 0x01 ) {
233   case 0:
234      chr_gen = memory_region(REGION_GFX1) + 0x1800;
235      break;
236   case 1:
237      chr_gen = memory_region(REGION_GFX1) + 0x1000;
238      break;
239   }
240
241   pcvideo_cga_set_character_base( chr_gen );
242}
243
244
245static void pc1512_set_cga_font( void ) {
246   UINT8   *chr_gen;
247
248   /* Check for changes in font dipsetting */
249   switch ( CGA_FONT & 0x03 ) {
250   case 0:
251      chr_gen = memory_region(REGION_GFX1) + 0x0000;
252      break;
253   case 1:
254      chr_gen = memory_region(REGION_GFX1) + 0x0800;
255      break;
256   case 2:
257      chr_gen = memory_region(REGION_GFX1) + 0x1000;
258      break;
259   case 3:
260      chr_gen = memory_region(REGION_GFX1) + 0x1800;
261      break;
262   }
263
264   pcvideo_cga_set_character_base( chr_gen );
265}
266
267228MACHINE_RESET( pc_mda )
268229{
269230   dma8237_reset();
r2162r2163
274235{
275236   dma8237_reset();
276237   cpunum_set_irq_callback(0, pc_irq_callback);
277   ibmpc_set_cga_font();
278238}
279239
280240MACHINE_RESET( pc_t1t )
r2162r2163
286246MACHINE_RESET( pc_pc1512 ) {
287247   dma8237_reset();
288248   cpunum_set_irq_callback(0, pc_irq_callback);
289   pc1512_set_cga_font();
290249}
291250
292251MACHINE_RESET( pc_aga )
r2162r2163
322281INTERRUPT_GEN( pc_cga_frame_interrupt )
323282{
324283   pc_generic_frame_interrupt(NULL);
325   ibmpc_set_cga_font();
326284}
327285
328286INTERRUPT_GEN( pc_pc1512_frame_interrupt )
329287{
330288   pc_generic_frame_interrupt(NULL);
331   pc1512_set_cga_font();
332289}
333290
334291INTERRUPT_GEN( tandy1000_frame_interrupt )
src/mess/drivers/at.c
r2162r2163
303303   PORT_INCLUDE( at_keyboard )      /* IN4 - IN11 */
304304   PORT_INCLUDE( pc_mouse_microsoft )   /* IN12 - IN14 */
305305   PORT_INCLUDE( pc_joystick )         /* IN15 - IN19 */
306   PORT_INCLUDE( pcvideo_cga_at )
306307INPUT_PORTS_END
307308
308309static INPUT_PORTS_START( atvga )
src/mess/drivers/pc.c
r2162r2163
493493   PORT_INCLUDE( pc_keyboard )      /* IN4 - IN11 */
494494   PORT_INCLUDE( pc_mouse_microsoft )   /* IN12 - IN14 */
495495   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 )
513497INPUT_PORTS_END
514498
515499static INPUT_PORTS_START( europc )
r2162r2163
720704   PORT_INCLUDE( pc_keyboard )      /* IN4 - IN11 */
721705   PORT_INCLUDE( pc_mouse_microsoft )   /* IN12 - IN14 */
722706   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 )
740708INPUT_PORTS_END
741709
742710static INPUT_PORTS_START( tandy1t )
r2162r2163
935903
936904   PORT_INCLUDE( pc_joystick_none )
937905
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 )
948907INPUT_PORTS_END
949908
950909static INPUT_PORTS_START( pc1640 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team