src/mess/video/pc_ega.c
| r2727 | r2728 | |
| 229 | 229 | |
| 230 | 230 | SR02 - 7 6 5 4 3 2 1 0 - Map Mask |
| 231 | 231 | | | | | | | | | |
| 232 | | | | | | | | | +-- 1 = enable map 0 |
| 233 | | | | | | | | +---- 1 = enable map 1 |
| 234 | | | | | | | +------ 1 = enable map 2 |
| 235 | | | | | | +-------- 1 = enable map 3 |
| 232 | | | | | | | | +-- 1 = enable map 0 for writing |
| 233 | | | | | | | +---- 1 = enable map 1 for writing |
| 234 | | | | | | +------ 1 = enable map 2 for writing |
| 235 | | | | | +-------- 1 = enable map 3 for writing |
| 236 | 236 | | | | +---------- reserved/unused |
| 237 | 237 | | | +------------ reserved/unused |
| 238 | 238 | | +-------------- reserved/unused |
| r2727 | r2728 | |
| 241 | 241 | |
| 242 | 242 | SR03 - 7 6 5 4 3 2 1 0 - Character Map Select |
| 243 | 243 | | | | | | | | | |
| 244 | | | | | | | | | +-- select plane for character map B |
| 245 | | | | | | | | +---- select plane for character map B |
| 246 | | | | | | | +------ select plane for character map A |
| 247 | | | | | | +-------- select plane for character map A |
| 244 | | | | | | | | +-- character map select B bit 0 |
| 245 | | | | | | | +---- character map select B bit 1 |
| 246 | | | | | | | Selects the map used to generate alpha characters when |
| 247 | | | | | | | attribute bit 3 is set to 0 |
| 248 | | | | | | | 00 = map 0 - 1st 8KB of plane 2 bank 0 |
| 249 | | | | | | | 01 = map 1 - 2nd 8KB of plane 2 bank 1 |
| 250 | | | | | | | 10 = map 2 - 3rd 8KB of plane 2 bank 2 |
| 251 | | | | | | | 11 = map 3 - 4th 8KB of plane 2 bank 3 |
| 252 | | | | | | +------ character map select A bit 0 |
| 253 | | | | | +-------- character map select A bit 1 |
| 254 | | | | | Selects the map used to generate alpha characters when |
| 255 | | | | | attribute bit 3 is set to 1 |
| 256 | | | | | 00 = map 0 - 1st 8KB of plane 2 bank 0 |
| 257 | | | | | 01 = map 1 - 2nd 8KB of plane 2 bank 1 |
| 258 | | | | | 10 = map 2 - 3rd 8KB of plane 2 bank 2 |
| 259 | | | | | 11 = map 3 - 4th 8KB of plane 2 bank 3 |
| 248 | 260 | | | | +---------- reserved/unused |
| 249 | 261 | | | +------------ reserved/unused |
| 250 | 262 | | +-------------- reserved/unused |
| 251 | 263 | +---------------- reserved/unused |
| 252 | | Meaning of the plane selection bits: |
| 253 | | 00 - 1st 8K plane 2 bank 0 |
| 254 | | 01 - 1st 8K plane 2 bank 1 |
| 255 | | 10 - 1st 8K plane 2 bank 2 |
| 256 | | 11 - 1st 8K plane 2 bank 3 |
| 257 | 264 | |
| 258 | 265 | |
| 259 | 266 | SR04 - 7 6 5 4 3 2 1 0 - Memory Mode Register |
| r2727 | r2728 | |
| 417 | 424 | const device_config *mc6845; |
| 418 | 425 | mc6845_update_row_func update_row; |
| 419 | 426 | |
| 427 | /* Video memory and related variables */ |
| 428 | UINT8 *videoram; |
| 429 | UINT8 *videoram_nothing; |
| 430 | UINT8 *videoram_a0000; |
| 431 | UINT8 *videoram_b0000; |
| 432 | UINT8 *videoram_b8000; |
| 433 | |
| 420 | 434 | /* Registers */ |
| 421 | 435 | UINT8 misc_output; |
| 422 | 436 | UINT8 feature_control; |
| r2727 | r2728 | |
| 449 | 463 | } ega; |
| 450 | 464 | |
| 451 | 465 | |
| 466 | /* |
| 467 | Prototypes |
| 468 | */ |
| 452 | 469 | static VIDEO_START( pc_ega ); |
| 453 | 470 | static VIDEO_UPDATE( mc6845_ega ); |
| 454 | 471 | static PALETTE_INIT( pc_ega ); |
| r2727 | r2728 | |
| 473 | 490 | static WRITE16_HANDLER( pc_ega16le_3d0_w ); |
| 474 | 491 | static READ32_HANDLER( pc_ega32le_3d0_r ); |
| 475 | 492 | static WRITE32_HANDLER( pc_ega32le_3d0_w ); |
| 493 | static WRITE8_HANDLER( pc_ega_videoram_w ); |
| 494 | static WRITE16_HANDLER( pc_ega_videoram16le_w ); |
| 495 | static WRITE32_HANDLER( pc_ega_videoram32le_w ); |
| 476 | 496 | |
| 477 | 497 | |
| 478 | 498 | static const mc6845_interface mc6845_ega_intf = |
| r2727 | r2728 | |
| 520 | 540 | } |
| 521 | 541 | |
| 522 | 542 | |
| 543 | static void pc_ega_install_banks( void ) |
| 544 | { |
| 545 | switch ( ega.graphics_controller.data[6] & 0x0c ) |
| 546 | { |
| 547 | case 0x00: /* 0xA0000, 128KB */ |
| 548 | ega.videoram_a0000 = ega.videoram + 0x10000; |
| 549 | ega.videoram_b0000 = ega.videoram; |
| 550 | ega.videoram_b8000 = ega.videoram + 0x8000; |
| 551 | break; |
| 552 | case 0x04: /* 0xA0000, 64KB */ |
| 553 | ega.videoram_a0000 = ega.videoram + 0x10000; |
| 554 | ega.videoram_b0000 = NULL; |
| 555 | ega.videoram_b8000 = NULL; |
| 556 | break; |
| 557 | case 0x08: /* 0xB0000, 32KB */ |
| 558 | ega.videoram_a0000 = NULL; |
| 559 | ega.videoram_b0000 = ega.videoram; |
| 560 | ega.videoram_b8000 = NULL; |
| 561 | break; |
| 562 | case 0x0c: /* 0xB8000, 32KB */ |
| 563 | ega.videoram_a0000 = NULL; |
| 564 | ega.videoram_b0000 = NULL; |
| 565 | ega.videoram_b8000 = ega.videoram; |
| 566 | break; |
| 567 | } |
| 568 | memory_set_bankptr( 11, ega.videoram_a0000 ? ega.videoram_a0000 : ega.videoram_nothing ); |
| 569 | memory_set_bankptr( 12, ega.videoram_b0000 ? ega.videoram_b0000 : ega.videoram_nothing ); |
| 570 | memory_set_bankptr( 13, ega.videoram_b8000 ? ega.videoram_b8000 : ega.videoram_nothing ); |
| 571 | } |
| 572 | |
| 573 | |
| 523 | 574 | static VIDEO_START( pc_ega ) |
| 524 | 575 | { |
| 525 | 576 | int buswidth; |
| r2727 | r2728 | |
| 528 | 579 | switch(buswidth) |
| 529 | 580 | { |
| 530 | 581 | case 8: |
| 531 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK11 ); |
| 532 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, pc_video_videoram_w ); |
| 582 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 583 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 584 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 585 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram_w ); |
| 533 | 586 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega8_3b0_r ); |
| 534 | 587 | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega8_3b0_w ); |
| 535 | 588 | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega8_3c0_r ); |
| r2727 | r2728 | |
| 539 | 592 | break; |
| 540 | 593 | |
| 541 | 594 | case 16: |
| 542 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK11 ); |
| 543 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, pc_video_videoram16le_w ); |
| 595 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 596 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 597 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 598 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram16le_w ); |
| 544 | 599 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega16le_3b0_r ); |
| 545 | 600 | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega16le_3b0_w ); |
| 546 | 601 | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega16le_3c0_r ); |
| r2727 | r2728 | |
| 550 | 605 | break; |
| 551 | 606 | |
| 552 | 607 | case 32: |
| 553 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK11 ); |
| 554 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, pc_video_videoram32_w ); |
| 608 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 609 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 610 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 611 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram32le_w ); |
| 555 | 612 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega32le_3b0_r ); |
| 556 | 613 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega32le_3b0_w ); |
| 557 | 614 | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega32le_3c0_r ); |
| r2727 | r2728 | |
| 565 | 622 | break; |
| 566 | 623 | } |
| 567 | 624 | |
| 568 | | /* 256KB Video ram max on an EGA card */ |
| 569 | | videoram_size = 0x40000; |
| 625 | memset( &ega, 0, sizeof( ega ) ); |
| 570 | 626 | |
| 571 | | videoram = auto_malloc(videoram_size); |
| 627 | /* Install 256KB Video ram on our EGA card */ |
| 628 | ega.videoram = memory_region( REGION_GFX2 ); |
| 572 | 629 | |
| 573 | | memory_set_bankptr(11, videoram); |
| 630 | memset( ega.videoram + 256 * 1024, 0xFF, 64 * 1024 ); |
| 574 | 631 | |
| 632 | ega.videoram_nothing = ega.videoram + ( 256 * 1024 ); |
| 633 | |
| 634 | pc_ega_install_banks(); |
| 635 | |
| 575 | 636 | ega.mc6845 = device_list_find_by_tag(machine->config->devicelist, MC6845, EGA_MC6845_NAME); |
| 576 | 637 | ega.update_row = NULL; |
| 577 | 638 | ega.misc_output = 0; |
| r2727 | r2728 | |
| 783 | 844 | } |
| 784 | 845 | else |
| 785 | 846 | { |
| 847 | logerror("AR%02X = 0x%02x\n", ega.attribute.index & 0x1F, data ); |
| 786 | 848 | ega.attribute.data[ ega.attribute.index & 0x1F ] = data; |
| 787 | 849 | } |
| 788 | 850 | ega.attribute.index_write ^= 0x01; |
| r2727 | r2728 | |
| 798 | 860 | ega.sequencer.index = data; |
| 799 | 861 | break; |
| 800 | 862 | case 5: |
| 801 | | //logerror("SR%02x = 0x%02x\n", ega.graphics_controller.index & 0x07, data ); |
| 863 | logerror("SR%02X = 0x%02x\n", ega.sequencer.index & 0x07, data ); |
| 802 | 864 | ega.sequencer.data[ ega.sequencer.index & 0x07 ] = data; |
| 803 | 865 | break; |
| 804 | 866 | |
| r2727 | r2728 | |
| 807 | 869 | ega.graphics_controller.index = data; |
| 808 | 870 | break; |
| 809 | 871 | case 15: |
| 810 | | //logoerror("GR%02x = 0x%02x\n", ega.graphics_controller.index & 0x0F, data ); |
| 872 | logerror("GR%02X = 0x%02x\n", ega.graphics_controller.index & 0x0F, data ); |
| 811 | 873 | ega.graphics_controller.data[ ega.graphics_controller.index & 0x0F ] = data; |
| 874 | switch ( ega.graphics_controller.index & 0x0F ) |
| 875 | { |
| 876 | case 6: /* GR06 */ |
| 877 | pc_ega_install_banks(); |
| 878 | break; |
| 879 | } |
| 812 | 880 | break; |
| 813 | 881 | } |
| 814 | 882 | } |
| r2727 | r2728 | |
| 828 | 896 | static READ32_HANDLER( pc_ega32le_3d0_r ) { return read32le_with_read8_handler(pc_ega8_3d0_r, machine, offset, mem_mask); } |
| 829 | 897 | static WRITE32_HANDLER( pc_ega32le_3d0_w ) { write32le_with_write8_handler(pc_ega8_3d0_w, machine, offset, data, mem_mask); } |
| 830 | 898 | |
| 899 | static WRITE8_HANDLER( pc_ega_videoram_w ) |
| 900 | { |
| 901 | switch ( offset & 0x18000 ) |
| 902 | { |
| 903 | case 0x00000: |
| 904 | case 0x08000: |
| 905 | if ( ega.videoram_a0000 ) |
| 906 | { |
| 907 | ega.videoram_a0000[offset & 0xffff] = data; |
| 908 | } |
| 909 | break; |
| 910 | case 0x10000: |
| 911 | if ( ega.videoram_b0000 ) |
| 912 | { |
| 913 | ega.videoram_b0000[offset & 0x7fff] = data; |
| 914 | } |
| 915 | break; |
| 916 | case 0x18000: |
| 917 | if ( ega.videoram_b8000 ) |
| 918 | { |
| 919 | ega.videoram_b8000[offset & 0x7fff] = data; |
| 920 | } |
| 921 | break; |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | static WRITE16_HANDLER( pc_ega_videoram16le_w ) { write16le_with_write8_handler(pc_ega_videoram_w, machine, offset, data, mem_mask); } |
| 926 | static WRITE32_HANDLER( pc_ega_videoram32le_w ) { write32le_with_write8_handler(pc_ega_videoram_w, machine, offset, data, mem_mask); } |
| 927 | |
src/mess/drivers/at.c
| r2727 | r2728 | |
| 72 | 72 | |
| 73 | 73 | static ADDRESS_MAP_START( at16_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 74 | 74 | AM_RANGE(0x000000, 0x09ffff) AM_MIRROR(0xff000000) AM_RAMBANK(10) |
| 75 | | AM_RANGE(0x0a0000, 0x0affff) AM_NOP |
| 76 | | AM_RANGE(0x0b0000, 0x0b7fff) AM_NOP |
| 77 | | // AM_RANGE(0x0b8000, 0x0bffff) AM_READWRITE(SMH_RAM, pc_video_videoram16le_w) AM_BASE((UINT16 **)&videoram) AM_SIZE(&videoram_size) |
| 75 | // AM_RANGE(0x0a0000, 0x0bffff) AM_READWRITE(SMH_RAM, pc_video_videoram16le_w) AM_BASE((UINT16 **)&videoram) AM_SIZE(&videoram_size) |
| 78 | 76 | AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM |
| 79 | 77 | AM_RANGE(0x0c8000, 0x0cffff) AM_ROM |
| 80 | 78 | AM_RANGE(0x0d0000, 0x0effff) AM_RAM |
| r2727 | r2728 | |
| 419 | 417 | |
| 420 | 418 | static MACHINE_DRIVER_START( ibm5170 ) |
| 421 | 419 | /* basic machine hardware */ |
| 422 | | MDRV_CPU_ATPC(at16, at16, I80286, 8000000 /*6000000*/) |
| 420 | MDRV_CPU_ATPC(at16, at16, I80286, 12000000 /*6000000*/) |
| 423 | 421 | |
| 424 | 422 | MDRV_DEVICE_ADD( AT_PIT8254, PIT8254 ) |
| 425 | 423 | MDRV_DEVICE_CONFIG( at_pit8254_config ) |
| r2727 | r2728 | |
| 746 | 744 | ROM_REGION(0x08100, REGION_GFX1, 0) |
| 747 | 745 | ROM_LOAD("cga.chr", 0x00000, 0x01000, CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd)) |
| 748 | 746 | |
| 747 | ROM_REGION(0x50000, REGION_GFX2, ROMREGION_ERASE00) |
| 748 | |
| 749 | 749 | /* This region holds the original EGA Video bios */ |
| 750 | 750 | ROM_REGION(0x4000, REGION_USER1, 0) |
| 751 | 751 | ROM_LOAD("6277356.u44", 0x0000, 0x4000, CRC(dc146448) SHA1(dc0794499b3e499c5777b3aa39554bbf0f2cc19b)) |
| r2727 | r2728 | |
| 884 | 884 | ***************************************************************************/ |
| 885 | 885 | |
| 886 | 886 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 887 | | COMP ( 1984, ibm5170, 0, ibm5160, ibm5170, atcga, atega, ibmat, "International Business Machines", "IBM PC/AT 5170 (CGA, MF2 Keyboard)", GAME_NOT_WORKING ) |
| 888 | | COMP ( 1985, ibm5170a, ibm5170, 0, ibm5170a, atcga, atega, ibmat, "International Business Machines", "IBM PC/AT 5170 8MHz (CGA, MF2 Keyboard)", GAME_NOT_WORKING ) |
| 887 | COMP ( 1984, ibm5170, 0, ibm5160, ibm5170, atcga, atega, ibmat, "International Business Machines", "IBM PC/AT 5170", GAME_NOT_WORKING ) |
| 888 | COMP ( 1985, ibm5170a, ibm5170, 0, ibm5170a, atcga, atega, ibmat, "International Business Machines", "IBM PC/AT 5170 8MHz", GAME_NOT_WORKING ) |
| 889 | 889 | COMP ( 1988, i8530286, ibm5170, 0, ps2m30286, atvga, ps2m30286, ibmat, "International Business Machines", "IBM PS2 Model 30 286", GAME_NOT_WORKING ) |
| 890 | 890 | COMP ( 1987, at, ibm5170, 0, ibm5170a, atcga, atcga, ibmat, "", "PC/AT (CGA, MF2 Keyboard)", GAME_NOT_WORKING ) |
| 891 | 891 | COMP ( 1989, neat, ibm5170, 0, ibm5170a, atcga, atcga, ibmat, "", "NEAT (CGA, MF2 Keyboard)", GAME_NOT_WORKING ) |