Previous 15994 Revisions Next

r2685 Wednesday 21st May, 2008 at 22:18:39 UTC by Wilbert Pol
[PC_EGA] Adding default palette. Adding some documentation.
[src/mess/video]pc_ega.c

src/mess/video/pc_ega.c
r2684r2685
2222   const device_config   *mc6845;
2323   mc6845_update_row_func   update_row;
2424
25   /* Attribute registers AR00 - AR14  */
25   /* Attribute registers AR00 - AR14
26   */
2627   struct {
2728      UINT8   index;
2829      UINT8   data[32];
2930   } attribute;
3031
31   /* Sequencer registers SR00 - SR07 */
32   /* Sequencer registers SR00 - SR04
33
34     SR00 - 7 6 5 4 3 2 1 0 - Reset Control Register
35            | | | | | | | |
36            | | | | | | | +-- Must be 1 for normal operation
37            | | | | | | +---- Must be 1 for normal operation
38            | | | | | +------ reserved/unused
39            | | | | +-------- reserved/unused
40            | | | +---------- reserved/unused
41            | | +------------ reserved/unused
42            | +-------------- reserved/unused
43            +---------------- reserved/unused
44
45     SR01 - 7 6 5 4 3 2 1 0 - Clocking Mode
46            | | | | | | | |
47            | | | | | | | +-- 0 = 9 dots per char, 1 = 8 dots per char
48            | | | | | | +---- clock frequency, 0 = 4 out of 5 memory cycles, 1 = 2 out of 5 memory cycles
49            | | | | | +------ shift load
50            | | | | +-------- 0 = normal dot clock, 1 = master dot clock / 2
51            | | | +---------- reserved/unused
52            | | +------------ reserved/unused
53            | +-------------- reserved/unused
54            +---------------- reserved/unused
55
56     SR02 - 7 6 5 4 3 2 1 0 - Map Mask
57            | | | | | | | |
58            | | | | | | | +-- 1 = enable map 0
59            | | | | | | +---- 1 = enable map 1
60            | | | | | +------ 1 = enable map 2
61            | | | | +-------- 1 = enable map 3
62            | | | +---------- reserved/unused
63            | | +------------ reserved/unused
64            | +-------------- reserved/unused
65            +---------------- reserved/unused
66
67     SR03 - 7 6 5 4 3 2 1 0 - Character Map Select
68            | | | | | | | |
69            | | | | | | | +-- select plane for character map B
70            | | | | | | +---- select plane for character map B
71            | | | | | +------ select plane for character map A
72            | | | | +-------- select plane for character map A
73            | | | +---------- reserved/unused
74            | | +------------ reserved/unused
75            | +-------------- reserved/unused
76            +---------------- reserved/unused
77          Meaning of the plane selection bits:
78          00 - 1st 8K plane 2 bank 0
79          01 - 1st 8K plane 2 bank 1
80          10 - 1st 8K plane 2 bank 2
81          11 - 1st 8K plane 2 bank 3
82
83     SR04 - 7 6 5 4 3 2 1 0 - Memory Mode Register
84            | | | | | | | |
85            | | | | | | | +-- 0 = graphics mode, 1 = text mode
86            | | | | | | +---- 0 = no memory extension, 1 = memory extension
87            | | | | | +------ 0 = odd/even storage, 1 = sequential storage
88            | | | | +-------- reserved/unused
89            | | | +---------- reserved/unused
90            | | +------------ reserved/unused
91            | +-------------- reserved/unused
92            +---------------- reserved/unused
93
94   */
3295   struct {
3396      UINT8   index;
3497      UINT8   data[8];
3598   } sequencer;
3699
37   /* Graphics controller registers GR00 - GR08 */
100   /* Graphics controller registers GR00 - GR08
101   */
38102   struct {
39103      UINT8   index;
40104      UINT8   data[16];
r2684r2685
69133static const mc6845_interface mc6845_ega_intf =
70134{
71135   EGA_SCREEN_NAME,   /* screen number */
72   XTAL_14_31818MHz/8,   /* clock (this is still wrong?) */
136   16257000/8,         /* clock */
73137   8,               /* numbers of pixels per video memory address */
74138   NULL,            /* begin_update */
75139   ega_update_row,      /* update_row */
r2684r2685
159223
160224   ega.mc6845 = device_list_find_by_tag(machine->config->devicelist, MC6845, EGA_MC6845_NAME);
161225   ega.update_row = NULL;
226
227   /* Set up default palette */
228   ega.attribute.data[0] = 0;
229   ega.attribute.data[1] = 1;
230   ega.attribute.data[2] = 2;
231   ega.attribute.data[3] = 3;
232   ega.attribute.data[4] = 4;
233   ega.attribute.data[5] = 5;
234   ega.attribute.data[6] = 0x14;
235   ega.attribute.data[7] = 7;
236   ega.attribute.data[8] = 0x38;
237   ega.attribute.data[9] = 0x39;
238   ega.attribute.data[10] = 0x3A;
239   ega.attribute.data[11] = 0x3B;
240   ega.attribute.data[12] = 0x3C;
241   ega.attribute.data[13] = 0x3D;
242   ega.attribute.data[14] = 0x3E;
243   ega.attribute.data[15] = 0x3F;
162244}
163245
164246
r2684r2685
321403   case 1:
322404      if ( ( ega.attribute.index & 0x30 ) != 0x20 )
323405      {
406//logerror("AR%02x = 0x%02x\n", ega.attribute.index & 0x1F, data );
324407         ega.attribute.data[ ega.attribute.index & 0x1F ] = data;
325408      }
326409      break;
r2684r2685
334417      ega.sequencer.index = data;
335418      break;
336419   case 5:
420//logerror("SR%02x = 0x%02x\n", ega.graphics_controller.index & 0x07, data );
337421      ega.sequencer.data[ ega.sequencer.index & 0x07 ] = data;
338422      break;
339423
r2684r2685
342426      ega.graphics_controller.index = data;
343427      break;
344428   case 15:
429//logoerror("GR%02x = 0x%02x\n", ega.graphics_controller.index & 0x0F, data );
345430      ega.graphics_controller.data[ ega.graphics_controller.index & 0x0F ] = data;
346431      break;
347432   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team