Previous 15994 Revisions Next

r2161 Sunday 30th March, 2008 at 13:46:52 UTC by Wilbert Pol
[PC_CGA] Moved the selection of the character set from the pc_cga video code to the machine layer code.
[src/mess/drivers]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
r2160r2161
77#ifndef PC_H_
88#define PC_H_
99
10/* Dipswitch for font selection */
11#define CGA_FONT        (readinputport(20)&3)
1012
1113/*----------- defined in machine/pc.c -----------*/
1214
r2160r2161
2426MACHINE_RESET( pc_cga );
2527MACHINE_RESET( pc_t1t );
2628MACHINE_RESET( pc_aga );
29MACHINE_RESET( pc_pc1512 );
2730MACHINE_RESET( pc_vga );
2831
2932INTERRUPT_GEN( pc_cga_frame_interrupt );
33INTERRUPT_GEN( pc_pc1512_frame_interrupt );
3034INTERRUPT_GEN( pc_mda_frame_interrupt );
3135INTERRUPT_GEN( tandy1000_frame_interrupt );
3236INTERRUPT_GEN( pc_aga_frame_interrupt );
src/mess/video/pc_cga.c
r2160r2161
336336   memset(&cga, 0, sizeof(cga));
337337   cga.update_row = NULL;
338338
339   cga.chr_gen = memory_region(REGION_GFX1) + 0x1000;
340
341339   state_save_register_item("pccga", 0, cga.mode_control);
342340   state_save_register_item("pccga", 0, cga.color_select);
343341   state_save_register_item("pccga", 0, cga.status);
r2160r2161
401399static VIDEO_UPDATE( mc6845_cga ) {
402400   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, CGA_MC6845_NAME);
403401   mc6845_update( devconf, bitmap, cliprect);
404
405   /* Check for changes in font dipsetting */
406   switch ( CGA_FONT & 0x01 ) {
407   case 0:
408      cga.chr_gen = memory_region(REGION_GFX1) + 0x1800;
409      break;
410   case 1:
411      cga.chr_gen = memory_region(REGION_GFX1) + 0x1000;
412      break;
413   }
414402   return 0;
415403}
416404
r2160r2161
14301418static VIDEO_UPDATE( mc6845_pc1512 ) {
14311419   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, CGA_MC6845_NAME);
14321420   mc6845_update( devconf, bitmap, cliprect);
1433
1434   /* Check for changes in font dipsetting */
1435   switch ( CGA_FONT & 0x03 ) {
1436   case 0:
1437      cga.chr_gen = memory_region(REGION_GFX1) + 0x0000;
1438      break;
1439   case 1:
1440      cga.chr_gen = memory_region(REGION_GFX1) + 0x0800;
1441      break;
1442   case 2:
1443      cga.chr_gen = memory_region(REGION_GFX1) + 0x1000;
1444      break;
1445   case 3:
1446      cga.chr_gen = memory_region(REGION_GFX1) + 0x1800;
1447      break;
1448   }
14491421   return 0;
14501422}
14511423
src/mess/video/pc_cga.h
r2160r2161
2525WRITE16_HANDLER( pc1512_videoram16le_w );
2626
2727
28/* Dipswitch for font selection */
29#define CGA_FONT      (readinputport(20)&3)
30
3128/* Dipswitch for monitor selection */
3229#define CGA_MONITOR     (readinputport(20)&0x1C)
3330#define CGA_MONITOR_RGB         0x00    /* Colour RGB */
src/mess/machine/at.c
r2160r2161
167167MACHINE_RESET( at )
168168{
169169   dma8237_reset();
170   pcvideo_cga_set_character_base( memory_region(REGION_GFX1) + 0x1000 );
170171}
src/mess/machine/pc.c
r2160r2161
224224   return pic8259_acknowledge(0);
225225}
226226
227
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
227267MACHINE_RESET( pc_mda )
228268{
229269   dma8237_reset();
r2160r2161
234274{
235275   dma8237_reset();
236276   cpunum_set_irq_callback(0, pc_irq_callback);
277   ibmpc_set_cga_font();
237278}
238279
239280MACHINE_RESET( pc_t1t )
r2160r2161
242283   cpunum_set_irq_callback(0, pc_irq_callback);
243284}
244285
286MACHINE_RESET( pc_pc1512 ) {
287   dma8237_reset();
288   cpunum_set_irq_callback(0, pc_irq_callback);
289   pc1512_set_cga_font();
290}
291
245292MACHINE_RESET( pc_aga )
246293{
247294   dma8237_reset();
r2160r2161
275322INTERRUPT_GEN( pc_cga_frame_interrupt )
276323{
277324   pc_generic_frame_interrupt(NULL);
325   ibmpc_set_cga_font();
278326}
279327
328INTERRUPT_GEN( pc_pc1512_frame_interrupt )
329{
330   pc_generic_frame_interrupt(NULL);
331   pc1512_set_cga_font();
332}
333
280334INTERRUPT_GEN( tandy1000_frame_interrupt )
281335{
282336   pc_generic_frame_interrupt(NULL);
src/mess/drivers/pc.c
r2160r2161
13351335
13361336static MACHINE_DRIVER_START( pc1512 )
13371337   /* basic machine hardware */
1338   MDRV_CPU_PC(pc1640, pc1640, I8086, 8000000, pc_cga_frame_interrupt)
1338   MDRV_CPU_PC(pc1640, pc1640, I8086, 8000000, pc_pc1512_frame_interrupt)
13391339
1340   MDRV_MACHINE_RESET(pc_aga)
1340   MDRV_MACHINE_RESET(pc_pc1512)
13411341
13421342   /* video hardware */
13431343   MDRV_IMPORT_FROM( pcvideo_pc1512 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team