src/mess/video/pc_ega.c
| r2684 | r2685 | |
| 22 | 22 | const device_config *mc6845; |
| 23 | 23 | mc6845_update_row_func update_row; |
| 24 | 24 | |
| 25 | | /* Attribute registers AR00 - AR14 */ |
| 25 | /* Attribute registers AR00 - AR14 |
| 26 | */ |
| 26 | 27 | struct { |
| 27 | 28 | UINT8 index; |
| 28 | 29 | UINT8 data[32]; |
| 29 | 30 | } attribute; |
| 30 | 31 | |
| 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 | */ |
| 32 | 95 | struct { |
| 33 | 96 | UINT8 index; |
| 34 | 97 | UINT8 data[8]; |
| 35 | 98 | } sequencer; |
| 36 | 99 | |
| 37 | | /* Graphics controller registers GR00 - GR08 */ |
| 100 | /* Graphics controller registers GR00 - GR08 |
| 101 | */ |
| 38 | 102 | struct { |
| 39 | 103 | UINT8 index; |
| 40 | 104 | UINT8 data[16]; |
| r2684 | r2685 | |
| 69 | 133 | static const mc6845_interface mc6845_ega_intf = |
| 70 | 134 | { |
| 71 | 135 | EGA_SCREEN_NAME, /* screen number */ |
| 72 | | XTAL_14_31818MHz/8, /* clock (this is still wrong?) */ |
| 136 | 16257000/8, /* clock */ |
| 73 | 137 | 8, /* numbers of pixels per video memory address */ |
| 74 | 138 | NULL, /* begin_update */ |
| 75 | 139 | ega_update_row, /* update_row */ |
| r2684 | r2685 | |
| 159 | 223 | |
| 160 | 224 | ega.mc6845 = device_list_find_by_tag(machine->config->devicelist, MC6845, EGA_MC6845_NAME); |
| 161 | 225 | 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; |
| 162 | 244 | } |
| 163 | 245 | |
| 164 | 246 | |
| r2684 | r2685 | |
| 321 | 403 | case 1: |
| 322 | 404 | if ( ( ega.attribute.index & 0x30 ) != 0x20 ) |
| 323 | 405 | { |
| 406 | //logerror("AR%02x = 0x%02x\n", ega.attribute.index & 0x1F, data ); |
| 324 | 407 | ega.attribute.data[ ega.attribute.index & 0x1F ] = data; |
| 325 | 408 | } |
| 326 | 409 | break; |
| r2684 | r2685 | |
| 334 | 417 | ega.sequencer.index = data; |
| 335 | 418 | break; |
| 336 | 419 | case 5: |
| 420 | //logerror("SR%02x = 0x%02x\n", ega.graphics_controller.index & 0x07, data ); |
| 337 | 421 | ega.sequencer.data[ ega.sequencer.index & 0x07 ] = data; |
| 338 | 422 | break; |
| 339 | 423 | |
| r2684 | r2685 | |
| 342 | 426 | ega.graphics_controller.index = data; |
| 343 | 427 | break; |
| 344 | 428 | case 15: |
| 429 | //logoerror("GR%02x = 0x%02x\n", ega.graphics_controller.index & 0x0F, data ); |
| 345 | 430 | ega.graphics_controller.data[ ega.graphics_controller.index & 0x0F ] = data; |
| 346 | 431 | break; |
| 347 | 432 | } |