src/emu/video/mc6845.c
| r11574 | r11575 | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
| 104 | | void mc6845_device::address_w(UINT8 data) |
| 104 | WRITE8_MEMBER( mc6845_device::address_w ) |
| 105 | 105 | { |
| 106 | 106 | m_register_address_latch = data & 0x1f; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | | UINT8 mc6845_device::status_r() |
| 110 | READ8_MEMBER( mc6845_device::status_r ) |
| 111 | 111 | { |
| 112 | 112 | UINT8 ret = 0; |
| 113 | 113 | |
| r11574 | r11575 | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
| 130 | | UINT8 mc6845_device::register_r() |
| 130 | READ8_MEMBER( mc6845_device::register_r ) |
| 131 | 131 | { |
| 132 | 132 | UINT8 ret = 0; |
| 133 | 133 | |
| r11574 | r11575 | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | | void mc6845_device::register_w(UINT8 data) |
| 171 | WRITE8_MEMBER( mc6845_device::register_w ) |
| 172 | 172 | { |
| 173 | 173 | if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data); |
| 174 | 174 | |
| r11574 | r11575 | |
| 975 | 975 | { |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | | |
| 979 | | /***************************************** |
| 980 | | * TRAMPOLINES |
| 981 | | *****************************************/ |
| 982 | | |
| 983 | | WRITE8_DEVICE_HANDLER( mc6845_address_w ) |
| 984 | | { |
| 985 | | downcast<mc6845_device *>(device)->address_w( data ); |
| 986 | | } |
| 987 | | |
| 988 | | READ8_DEVICE_HANDLER( mc6845_status_r ) |
| 989 | | { |
| 990 | | return downcast<mc6845_device *>(device)->status_r(); |
| 991 | | } |
| 992 | | |
| 993 | | READ8_DEVICE_HANDLER( mc6845_register_r ) |
| 994 | | { |
| 995 | | return downcast<mc6845_device *>(device)->register_r(); |
| 996 | | } |
| 997 | | |
| 998 | | WRITE8_DEVICE_HANDLER( mc6845_register_w ) |
| 999 | | { |
| 1000 | | downcast<mc6845_device *>(device)->register_w( data ); |
| 1001 | | } |
| 1002 | | |
| 1003 | | UINT16 mc6845_get_ma(device_t *device) |
| 1004 | | { |
| 1005 | | return downcast<mc6845_device *>(device)->get_ma(); |
| 1006 | | } |
| 1007 | | |
| 1008 | | UINT8 mc6845_get_ra(device_t *device) |
| 1009 | | { |
| 1010 | | return downcast<mc6845_device *>(device)->get_ra(); |
| 1011 | | } |
| 1012 | | |
| 1013 | | void mc6845_assert_light_pen_input(device_t *device) |
| 1014 | | { |
| 1015 | | downcast<mc6845_device *>(device)->assert_light_pen_input(); |
| 1016 | | } |
| 1017 | | |
| 1018 | | void mc6845_set_clock(device_t *device, int clock) |
| 1019 | | { |
| 1020 | | downcast<mc6845_device *>(device)->set_clock( clock ); |
| 1021 | | } |
| 1022 | | |
| 1023 | | void mc6845_set_hpixels_per_column(device_t *device, int hpixels_per_column) |
| 1024 | | { |
| 1025 | | downcast<mc6845_device *>(device)->set_hpixels_per_column( hpixels_per_column ); |
| 1026 | | } |
| 1027 | | |
| 1028 | | void mc6845_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1029 | | { |
| 1030 | | downcast<mc6845_device *>(device)->update( bitmap, cliprect ); |
| 1031 | | } |
| 1032 | | |
| 1033 | | |
src/mess/machine/pet.c
| r11574 | r11575 | |
| 408 | 408 | via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0"); |
| 409 | 409 | pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0"); |
| 410 | 410 | pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1"); |
| 411 | | device_t *mc6845 = space->machine().device("crtc"); |
| 411 | mc6845_device *mc6845 = space->machine().device<mc6845_device>("crtc"); |
| 412 | 412 | |
| 413 | 413 | if (offset < 0x10) ; |
| 414 | 414 | else if (offset < 0x14) pia_0->write(*space, offset & 3, data); |
| r11574 | r11575 | |
| 417 | 417 | else if (offset < 0x40) ; |
| 418 | 418 | else if (offset < 0x50) via_0->write(*space, offset & 0xf, data); |
| 419 | 419 | else if (offset < 0x80) ; |
| 420 | | else if (offset == 0x80) mc6845_address_w(mc6845, 0, data); |
| 421 | | else if (offset == 0x81) mc6845_register_w(mc6845, 0, data); |
| 420 | else if (offset == 0x80) mc6845->address_w(*space, 0, data); |
| 421 | else if (offset == 0x81) mc6845->register_w(*space, 0, data); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | static READ8_HANDLER( cbm8096_io_r ) |
| r11574 | r11575 | |
| 426 | 426 | via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0"); |
| 427 | 427 | pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0"); |
| 428 | 428 | pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1"); |
| 429 | | device_t *mc6845 = space->machine().device("crtc"); |
| 429 | mc6845_device *mc6845 = space->machine().device<mc6845_device>("crtc"); |
| 430 | 430 | |
| 431 | 431 | int data = 0xff; |
| 432 | 432 | if (offset < 0x10) ; |
| r11574 | r11575 | |
| 436 | 436 | else if (offset < 0x40) ; |
| 437 | 437 | else if (offset < 0x50) data = via_0->read(*space, offset & 0xf); |
| 438 | 438 | else if (offset < 0x80) ; |
| 439 | | else if (offset == 0x81) data = mc6845_register_r(mc6845, 0); |
| 439 | else if (offset == 0x81) data = mc6845->register_r(*space, 0); |
| 440 | 440 | return data; |
| 441 | 441 | } |
| 442 | 442 | |
src/mess/machine/amstrad.c
| r11574 | r11575 | |
| 992 | 992 | if ( ! drvstate->m_gate_array.de && state ) |
| 993 | 993 | { |
| 994 | 994 | /* DE became active, store the starting MA and RA signals */ |
| 995 | | device_t *mc6845 = device->machine().device("mc6845" ); |
| 995 | mc6845_device *mc6845 = device->machine().device<mc6845_device>("mc6845" ); |
| 996 | 996 | |
| 997 | | drvstate->m_gate_array.ma = mc6845_get_ma( mc6845 ); |
| 998 | | drvstate->m_gate_array.ra = mc6845_get_ra( mc6845 ); |
| 997 | drvstate->m_gate_array.ma = mc6845->get_ma(); |
| 998 | drvstate->m_gate_array.ra = mc6845->get_ra(); |
| 999 | 999 | logerror("y = %d; ma = %02x; ra = %02x, address = %04x\n", drvstate->m_gate_array.y, drvstate->m_gate_array.ma, drvstate->m_gate_array.ra, ( ( drvstate->m_gate_array.ma & 0x3000 ) << 2 ) | ( ( drvstate->m_gate_array.ra & 0x07 ) << 11 ) | ( ( drvstate->m_gate_array.ma & 0x3ff ) << 1 ) ); |
| 1000 | 1000 | amstrad_gate_array_get_video_data(device->machine()); |
| 1001 | 1001 | drvstate->m_asic.de_start = 1; |
| r11574 | r11575 | |
| 1013 | 1013 | if ( ! drvstate->m_gate_array.de && state ) |
| 1014 | 1014 | { |
| 1015 | 1015 | /* DE became active, store the starting MA and RA signals */ |
| 1016 | | device_t *mc6845 = device->machine().device("mc6845" ); |
| 1016 | mc6845_device *mc6845 = device->machine().device<mc6845_device>("mc6845" ); |
| 1017 | 1017 | |
| 1018 | | drvstate->m_gate_array.ma = mc6845_get_ma( mc6845 ); |
| 1019 | | drvstate->m_gate_array.ra = mc6845_get_ra( mc6845 ); |
| 1018 | drvstate->m_gate_array.ma = mc6845->get_ma(); |
| 1019 | drvstate->m_gate_array.ra = mc6845->get_ra(); |
| 1020 | 1020 | drvstate->m_asic.h_start = drvstate->m_gate_array.line_ticks; |
| 1021 | 1021 | drvstate->m_asic.de_start = 1; |
| 1022 | 1022 | |
| r11574 | r11575 | |
| 2069 | 2069 | { |
| 2070 | 2070 | amstrad_state *state = space->machine().driver_data<amstrad_state>(); |
| 2071 | 2071 | device_t *fdc = space->machine().device("upd765"); |
| 2072 | | device_t *mc6845 = space->machine().device("mc6845" ); |
| 2072 | mc6845_device *mc6845 = space->machine().device<mc6845_device>("mc6845" ); |
| 2073 | 2073 | |
| 2074 | 2074 | unsigned char data = 0xFF; |
| 2075 | 2075 | unsigned int r1r0 = (unsigned int)((offset & 0x0300) >> 8); |
| r11574 | r11575 | |
| 2095 | 2095 | switch(r1r0) |
| 2096 | 2096 | { |
| 2097 | 2097 | case 0x02: |
| 2098 | | data = mc6845_status_r( mc6845, 0 ); |
| 2098 | data = mc6845->status_r( *space, 0 ); |
| 2099 | 2099 | #if 0 |
| 2100 | 2100 | /* CRTC Type 1 : Read Status Register |
| 2101 | 2101 | CRTC Type 3 or 4 : Read from selected internal 6845 register */ |
| r11574 | r11575 | |
| 2114 | 2114 | break; |
| 2115 | 2115 | case 0x03: |
| 2116 | 2116 | /* All CRTC type : Read from selected internal 6845 register Read only */ |
| 2117 | | data = mc6845_register_r( mc6845, 0 ); |
| 2117 | data = mc6845->register_r( *space, (offs_t)0 ); |
| 2118 | 2118 | break; |
| 2119 | 2119 | } |
| 2120 | 2120 | } |
| r11574 | r11575 | |
| 2207 | 2207 | { |
| 2208 | 2208 | amstrad_state *state = space->machine().driver_data<amstrad_state>(); |
| 2209 | 2209 | device_t *fdc = space->machine().device("upd765"); |
| 2210 | | device_t *mc6845 = space->machine().device("mc6845"); |
| 2210 | mc6845_device *mc6845 = space->machine().device<mc6845_device>("mc6845"); |
| 2211 | 2211 | |
| 2212 | 2212 | if ((offset & (1<<15)) == 0) |
| 2213 | 2213 | { |
| r11574 | r11575 | |
| 2233 | 2233 | switch ((offset & 0x0300) >> 8) // r1r0 |
| 2234 | 2234 | { |
| 2235 | 2235 | case 0x00: /* Select internal 6845 register Write Only */ |
| 2236 | | mc6845_address_w( mc6845, 0, data ); |
| 2236 | mc6845->address_w( *space, 0, data ); |
| 2237 | 2237 | if ( state->m_system_type == SYSTEM_PLUS || state->m_system_type == SYSTEM_GX4000 ) |
| 2238 | 2238 | amstrad_plus_seqcheck(state, data); |
| 2239 | 2239 | |
| r11574 | r11575 | |
| 2248 | 2248 | amstrad_plus_update_video(space->machine()); |
| 2249 | 2249 | else |
| 2250 | 2250 | amstrad_update_video(space->machine()); |
| 2251 | | mc6845_register_w( mc6845, 0, data ); |
| 2251 | mc6845->register_w( *space, 0, data ); |
| 2252 | 2252 | |
| 2253 | 2253 | /* printer port bit 8 */ |
| 2254 | 2254 | if (state->m_printer_bit8_selected && state->m_system_type == SYSTEM_PLUS) |
| r11574 | r11575 | |
| 2362 | 2362 | { |
| 2363 | 2363 | state->m_aleste_mode = data; |
| 2364 | 2364 | logerror("EXTEND: Port &FABF write 0x%02x\n",data); |
| 2365 | | mc6845_set_clock( mc6845, ( state->m_aleste_mode & 0x02 ) ? ( XTAL_16MHz / 8 ) : ( XTAL_16MHz / 16 ) ); |
| 2365 | mc6845->set_clock( ( state->m_aleste_mode & 0x02 ) ? ( XTAL_16MHz / 8 ) : ( XTAL_16MHz / 16 ) ); |
| 2366 | 2366 | } |
| 2367 | 2367 | |
| 2368 | 2368 | multiface_io_write(space, offset, data); |
| r11574 | r11575 | |
| 2374 | 2374 | { |
| 2375 | 2375 | amstrad_state *state = machine.driver_data<amstrad_state>(); |
| 2376 | 2376 | address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 2377 | | device_t *mc6845 = space->machine().device("mc6845" ); |
| 2377 | mc6845_device *mc6845 = space->machine().device<mc6845_device>("mc6845"); |
| 2378 | 2378 | device_t *ay8910 = machine.device("ay"); |
| 2379 | 2379 | int RegData; |
| 2380 | 2380 | int i; |
| r11574 | r11575 | |
| 2463 | 2463 | /* init CRTC */ |
| 2464 | 2464 | for (i=0; i<18; i++) |
| 2465 | 2465 | { |
| 2466 | | mc6845_address_w( mc6845, 0, i ); |
| 2467 | | mc6845_register_w( mc6845, 0, pSnapshot[0x043+i] & 0xff ); |
| 2466 | mc6845->address_w( *space, 0, i ); |
| 2467 | mc6845->register_w( *space, 0, pSnapshot[0x043+i] & 0xff ); |
| 2468 | 2468 | } |
| 2469 | 2469 | |
| 2470 | | mc6845_address_w( mc6845, 0, i ); |
| 2470 | mc6845->address_w( *space, 0, i ); |
| 2471 | 2471 | |
| 2472 | 2472 | /* upper rom selection */ |
| 2473 | 2473 | state->m_gate_array.upper_bank = pSnapshot[0x055]; |
| r11574 | r11575 | |
| 2769 | 2769 | data |= 0x02; |
| 2770 | 2770 | } |
| 2771 | 2771 | |
| 2772 | logerror("amstrad_ppi_portb_r\n"); |
| 2772 | 2773 | /* Schedule a write to PC2 */ |
| 2773 | 2774 | device->machine().scheduler().timer_set( attotime::zero, FUNC(amstrad_pc2_low)); |
| 2774 | 2775 | |
src/mess/video/isa_mda.c
| r11574 | r11575 | |
| 205 | 205 | |
| 206 | 206 | static SCREEN_UPDATE( mc6845_mda ) |
| 207 | 207 | { |
| 208 | | device_t *devconf = screen->owner()->subdevice(MDA_MC6845_NAME); |
| 209 | | mc6845_update( devconf, bitmap, cliprect ); |
| 208 | mc6845_device *mc6845 = screen->owner()->subdevice<mc6845_device>(MDA_MC6845_NAME); |
| 209 | mc6845->update( bitmap, cliprect ); |
| 210 | 210 | return 0; |
| 211 | 211 | } |
| 212 | 212 | |
| r11574 | r11575 | |
| 444 | 444 | *************************************************************************/ |
| 445 | 445 | WRITE8_DEVICE_HANDLER ( pc_MDA_w ) |
| 446 | 446 | { |
| 447 | | device_t *devconf = device->subdevice(MDA_MC6845_NAME); |
| 447 | mc6845_device *mc6845 = device->subdevice<mc6845_device>(MDA_MC6845_NAME); |
| 448 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 448 | 449 | device_t *lpt = device->subdevice("lpt"); |
| 449 | 450 | switch( offset ) |
| 450 | 451 | { |
| 451 | 452 | case 0: case 2: case 4: case 6: |
| 452 | | mc6845_address_w( devconf, offset, data ); |
| 453 | mc6845->address_w( *space, offset, data ); |
| 453 | 454 | break; |
| 454 | 455 | case 1: case 3: case 5: case 7: |
| 455 | | mc6845_register_w( devconf, offset, data ); |
| 456 | mc6845->register_w( *space, offset, data ); |
| 456 | 457 | break; |
| 457 | 458 | case 8: |
| 458 | 459 | mda_mode_control_w(device, offset, data); |
| r11574 | r11575 | |
| 466 | 467 | READ8_DEVICE_HANDLER ( pc_MDA_r ) |
| 467 | 468 | { |
| 468 | 469 | int data = 0xff; |
| 469 | | device_t *devconf = device->subdevice(MDA_MC6845_NAME); |
| 470 | mc6845_device *mc6845 = device->subdevice<mc6845_device>(MDA_MC6845_NAME); |
| 471 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 470 | 472 | device_t *lpt = device->subdevice("lpt"); |
| 471 | 473 | switch( offset ) |
| 472 | 474 | { |
| r11574 | r11575 | |
| 474 | 476 | /* return last written mc6845 address value here? */ |
| 475 | 477 | break; |
| 476 | 478 | case 1: case 3: case 5: case 7: |
| 477 | | data = mc6845_register_r( devconf, offset ); |
| 479 | data = mc6845->register_r( *space, offset ); |
| 478 | 480 | break; |
| 479 | 481 | case 10: |
| 480 | 482 | data = mda_status_r(device, offset); |
| r11574 | r11575 | |
| 653 | 655 | |
| 654 | 656 | static SCREEN_UPDATE( mc6845_hercules ) |
| 655 | 657 | { |
| 656 | | device_t *devconf = screen->owner()->subdevice(HERCULES_MC6845_NAME); |
| 658 | mc6845_device *mc6845 = screen->owner()->subdevice<mc6845_device>(HERCULES_MC6845_NAME); |
| 657 | 659 | |
| 658 | | mc6845_update( devconf, bitmap, cliprect ); |
| 660 | mc6845->update( bitmap, cliprect ); |
| 659 | 661 | return 0; |
| 660 | 662 | } |
| 661 | 663 | |
| r11574 | r11575 | |
| 684 | 686 | herc->update_row = NULL; |
| 685 | 687 | } |
| 686 | 688 | |
| 687 | | mc6845_set_clock( device, herc->mode_control & 0x02 ? MDA_CLOCK / 16 : MDA_CLOCK / 9 ); |
| 688 | | mc6845_set_hpixels_per_column( device, herc->mode_control & 0x02 ? 16 : 9 ); |
| 689 | downcast<mc6845_device *>(device)->set_clock( herc->mode_control & 0x02 ? MDA_CLOCK / 16 : MDA_CLOCK / 9 ); |
| 690 | downcast<mc6845_device *>(device)->set_hpixels_per_column( herc->mode_control & 0x02 ? 16 : 9 ); |
| 689 | 691 | } |
| 690 | 692 | |
| 691 | 693 | |
| r11574 | r11575 | |
| 699 | 701 | |
| 700 | 702 | static WRITE8_DEVICE_HANDLER ( hercules_w ) |
| 701 | 703 | { |
| 702 | | device_t *devconf = device->subdevice(HERCULES_MC6845_NAME); |
| 704 | mc6845_device *mc6845 = device->subdevice<mc6845_device>(HERCULES_MC6845_NAME); |
| 705 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 703 | 706 | device_t *lpt = device->subdevice("lpt"); |
| 704 | 707 | switch( offset ) |
| 705 | 708 | { |
| 706 | 709 | case 0: case 2: case 4: case 6: |
| 707 | | mc6845_address_w( devconf, offset, data ); |
| 710 | mc6845->address_w( *space, offset, data ); |
| 708 | 711 | break; |
| 709 | 712 | case 1: case 3: case 5: case 7: |
| 710 | | mc6845_register_w( devconf, offset, data ); |
| 713 | mc6845->register_w( *space, offset, data ); |
| 711 | 714 | break; |
| 712 | 715 | case 8: |
| 713 | | hercules_mode_control_w(devconf, offset, data); |
| 716 | hercules_mode_control_w(mc6845, offset, data); |
| 714 | 717 | break; |
| 715 | 718 | case 12: case 13: case 14: |
| 716 | 719 | pc_lpt_w(lpt, offset - 12, data); |
| r11574 | r11575 | |
| 743 | 746 | static READ8_DEVICE_HANDLER ( hercules_r ) |
| 744 | 747 | { |
| 745 | 748 | int data = 0xff; |
| 746 | | device_t *devconf = device->subdevice(HERCULES_MC6845_NAME); |
| 749 | mc6845_device *mc6845 = device->subdevice<mc6845_device>(HERCULES_MC6845_NAME); |
| 750 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 747 | 751 | device_t *lpt = device->subdevice("lpt"); |
| 748 | 752 | switch( offset ) |
| 749 | 753 | { |
| r11574 | r11575 | |
| 751 | 755 | /* return last written mc6845 address value here? */ |
| 752 | 756 | break; |
| 753 | 757 | case 1: case 3: case 5: case 7: |
| 754 | | data = mc6845_register_r( devconf, offset ); |
| 758 | data = mc6845->register_r( *space, offset ); |
| 755 | 759 | break; |
| 756 | 760 | case 10: |
| 757 | 761 | data = hercules_status_r(device, offset); |
src/mess/video/pc_t1t.c
| r11574 | r11575 | |
| 157 | 157 | |
| 158 | 158 | static SCREEN_UPDATE( mc6845_t1000 ) |
| 159 | 159 | { |
| 160 | | device_t *devconf = screen->machine().device(T1000_MC6845_NAME); |
| 161 | | mc6845_update( devconf, bitmap, cliprect); |
| 160 | mc6845_device *mc6845 = screen->machine().device<mc6845_device>(T1000_MC6845_NAME); |
| 161 | mc6845->update( bitmap, cliprect); |
| 162 | 162 | return 0; |
| 163 | 163 | } |
| 164 | 164 | |
| r11574 | r11575 | |
| 474 | 474 | |
| 475 | 475 | static void pc_pcjr_mode_switch( running_machine &machine ) |
| 476 | 476 | { |
| 477 | | device_t *mc6845 = machine.device(T1000_MC6845_NAME); |
| 477 | mc6845_device *mc6845 = machine.device<mc6845_device>(T1000_MC6845_NAME); |
| 478 | 478 | |
| 479 | 479 | switch( pcjr.reg.data[0] & 0x1A ) |
| 480 | 480 | { |
| r11574 | r11575 | |
| 516 | 516 | /* Determine mc6845 input clock */ |
| 517 | 517 | if ( pcjr.reg.data[0] & 0x01 ) |
| 518 | 518 | { |
| 519 | | mc6845_set_clock( mc6845, XTAL_14_31818MHz/8 ); |
| 519 | mc6845->set_clock( XTAL_14_31818MHz/8 ); |
| 520 | 520 | } |
| 521 | 521 | else |
| 522 | 522 | { |
| 523 | | mc6845_set_clock( mc6845, XTAL_14_31818MHz/16 ); |
| 523 | mc6845->set_clock( XTAL_14_31818MHz/16 ); |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | /* color or b/w? */ |
| r11574 | r11575 | |
| 771 | 771 | |
| 772 | 772 | WRITE8_HANDLER ( pc_T1T_w ) |
| 773 | 773 | { |
| 774 | | device_t *devconf; |
| 774 | mc6845_device *mc6845; |
| 775 | 775 | |
| 776 | 776 | switch( offset ) |
| 777 | 777 | { |
| 778 | 778 | case 0: case 2: case 4: case 6: |
| 779 | | devconf = space->machine().device(T1000_MC6845_NAME); |
| 780 | | mc6845_address_w( devconf, offset, data ); |
| 779 | mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME); |
| 780 | mc6845->address_w( *space, offset, data ); |
| 781 | 781 | break; |
| 782 | 782 | case 1: case 3: case 5: case 7: |
| 783 | | devconf = space->machine().device(T1000_MC6845_NAME); |
| 784 | | mc6845_register_w( devconf, offset, data ); |
| 783 | mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME); |
| 784 | mc6845->register_w( *space, offset, data ); |
| 785 | 785 | break; |
| 786 | 786 | case 8: |
| 787 | 787 | pc_t1t_mode_control_w(data); |
| r11574 | r11575 | |
| 811 | 811 | |
| 812 | 812 | WRITE8_HANDLER( pc_pcjr_w ) |
| 813 | 813 | { |
| 814 | | device_t *devconf; |
| 814 | mc6845_device *mc6845; |
| 815 | 815 | |
| 816 | 816 | switch( offset ) |
| 817 | 817 | { |
| 818 | 818 | case 0: case 4: |
| 819 | | devconf = space->machine().device(T1000_MC6845_NAME); |
| 820 | | mc6845_address_w( devconf, offset, data ); |
| 819 | mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME); |
| 820 | mc6845->address_w( *space, offset, data ); |
| 821 | 821 | break; |
| 822 | 822 | case 1: case 5: |
| 823 | | devconf = space->machine().device(T1000_MC6845_NAME); |
| 824 | | mc6845_register_w( devconf, offset, data ); |
| 823 | mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME); |
| 824 | mc6845->register_w( *space, offset, data ); |
| 825 | 825 | break; |
| 826 | 826 | case 10: |
| 827 | 827 | if ( pcjr.address_data_ff & 0x01 ) |
| r11574 | r11575 | |
| 851 | 851 | |
| 852 | 852 | READ8_HANDLER ( pc_T1T_r ) |
| 853 | 853 | { |
| 854 | | device_t *devconf; |
| 854 | mc6845_device *mc6845; |
| 855 | 855 | int data = 0xff; |
| 856 | 856 | |
| 857 | 857 | switch( offset ) |
| r11574 | r11575 | |
| 861 | 861 | break; |
| 862 | 862 | |
| 863 | 863 | case 1: case 3: case 5: case 7: |
| 864 | | devconf = space->machine().device(T1000_MC6845_NAME); |
| 865 | | data = mc6845_register_r( devconf, offset ); |
| 864 | mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME); |
| 865 | data = mc6845->register_r( *space, offset ); |
| 866 | 866 | break; |
| 867 | 867 | |
| 868 | 868 | case 8: |
src/mess/video/pc_cga.c
| r11574 | r11575 | |
| 548 | 548 | static SCREEN_UPDATE( mc6845_cga ) |
| 549 | 549 | { |
| 550 | 550 | UINT8 *gfx = screen->machine().region("gfx1")->base(); |
| 551 | | device_t *devconf = screen->machine().device(CGA_MC6845_NAME); |
| 552 | | mc6845_update( devconf, bitmap, cliprect); |
| 551 | mc6845_device *mc6845 = screen->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 552 | mc6845->update( bitmap, cliprect); |
| 553 | 553 | |
| 554 | 554 | /* Check for changes in font dipsetting */ |
| 555 | 555 | switch ( CGA_FONT & 0x01 ) |
| r11574 | r11575 | |
| 574 | 574 | static SCREEN_UPDATE( cga_poisk2 ) |
| 575 | 575 | { |
| 576 | 576 | UINT8 *gfx = screen->machine().region("gfx1")->base(); |
| 577 | | device_t *devconf = screen->machine().device(CGA_MC6845_NAME); |
| 578 | | mc6845_update( devconf, bitmap, cliprect); |
| 577 | mc6845_device *mc6845 = screen->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 578 | mc6845->update( bitmap, cliprect); |
| 579 | 579 | |
| 580 | 580 | /* Check for changes in font dipsetting */ |
| 581 | 581 | switch ( CGA_FONT & 0x01 ) |
| r11574 | r11575 | |
| 1124 | 1124 | */ |
| 1125 | 1125 | static void pc_cga_mode_control_w(running_machine &machine, int data) |
| 1126 | 1126 | { |
| 1127 | | device_t *devconf = machine.device(CGA_MC6845_NAME); |
| 1127 | mc6845_device *mc6845 = machine.device<mc6845_device>(CGA_MC6845_NAME); |
| 1128 | 1128 | |
| 1129 | 1129 | CGA_LOG(1,"CGA_mode_control_w",("$%02x: columns %d, gfx %d, hires %d, blink %d\n", |
| 1130 | 1130 | data, (data&1)?80:40, (data>>1)&1, (data>>4)&1, (data>>5)&1)); |
| r11574 | r11575 | |
| 1135 | 1135 | switch ( cga.mode_control & 0x3F ) |
| 1136 | 1136 | { |
| 1137 | 1137 | case 0x08: case 0x09: case 0x0C: case 0x0D: |
| 1138 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1138 | mc6845->set_hpixels_per_column( 8 ); |
| 1139 | 1139 | if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) |
| 1140 | 1140 | { |
| 1141 | 1141 | if ( cga.mode_control & 0x04 ) |
| r11574 | r11575 | |
| 1156 | 1156 | } |
| 1157 | 1157 | break; |
| 1158 | 1158 | case 0x0A: case 0x0B: case 0x2A: case 0x2B: |
| 1159 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1159 | mc6845->set_hpixels_per_column( 8 ); |
| 1160 | 1160 | if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) |
| 1161 | 1161 | { |
| 1162 | 1162 | cga.update_row = cga_gfx_4bppl_update_row; |
| r11574 | r11575 | |
| 1167 | 1167 | } |
| 1168 | 1168 | break; |
| 1169 | 1169 | case 0x0E: case 0x0F: case 0x2E: case 0x2F: |
| 1170 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1170 | mc6845->set_hpixels_per_column( 8 ); |
| 1171 | 1171 | cga.update_row = cga_gfx_2bpp_update_row; |
| 1172 | 1172 | break; |
| 1173 | 1173 | case 0x18: case 0x19: case 0x1C: case 0x1D: |
| 1174 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1174 | mc6845->set_hpixels_per_column( 8 ); |
| 1175 | 1175 | cga.update_row = cga_text_inten_alt_update_row; |
| 1176 | 1176 | break; |
| 1177 | 1177 | case 0x1A: case 0x1B: case 0x3A: case 0x3B: |
| 1178 | | mc6845_set_hpixels_per_column( devconf, 16 ); |
| 1178 | mc6845->set_hpixels_per_column( 16 ); |
| 1179 | 1179 | if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) |
| 1180 | 1180 | { |
| 1181 | 1181 | cga.update_row = cga_gfx_4bpph_update_row; |
| r11574 | r11575 | |
| 1186 | 1186 | } |
| 1187 | 1187 | break; |
| 1188 | 1188 | case 0x1E: case 0x1F: case 0x3E: case 0x3F: |
| 1189 | | mc6845_set_hpixels_per_column( devconf, 16 ); |
| 1189 | mc6845->set_hpixels_per_column( 16 ); |
| 1190 | 1190 | cga.update_row = cga_gfx_1bpp_update_row; |
| 1191 | 1191 | break; |
| 1192 | 1192 | case 0x28: case 0x29: case 0x2C: case 0x2D: |
| 1193 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1193 | mc6845->set_hpixels_per_column( 8 ); |
| 1194 | 1194 | if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) |
| 1195 | 1195 | { |
| 1196 | 1196 | if ( cga.mode_control & 0x04 ) |
| r11574 | r11575 | |
| 1211 | 1211 | } |
| 1212 | 1212 | break; |
| 1213 | 1213 | case 0x38: case 0x39: case 0x3C: case 0x3D: |
| 1214 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1214 | mc6845->set_hpixels_per_column( 8 ); |
| 1215 | 1215 | cga.update_row = cga_text_blink_alt_update_row; |
| 1216 | 1216 | break; |
| 1217 | 1217 | default: |
| r11574 | r11575 | |
| 1284 | 1284 | |
| 1285 | 1285 | static READ8_HANDLER( pc_cga8_r ) |
| 1286 | 1286 | { |
| 1287 | | device_t *devconf = space->machine().device(CGA_MC6845_NAME); |
| 1287 | mc6845_device *mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 1288 | 1288 | int data = 0xff; |
| 1289 | 1289 | switch( offset ) |
| 1290 | 1290 | { |
| r11574 | r11575 | |
| 1292 | 1292 | /* return last written mc6845 address value here? */ |
| 1293 | 1293 | break; |
| 1294 | 1294 | case 1: case 3: case 5: case 7: |
| 1295 | | data = mc6845_register_r( devconf, offset ); |
| 1295 | data = mc6845->register_r( *space, offset ); |
| 1296 | 1296 | break; |
| 1297 | 1297 | case 10: |
| 1298 | 1298 | data = cga.vsync | ( ( data & 0x40 ) >> 4 ) | cga.hsync; |
| r11574 | r11575 | |
| 1308 | 1308 | |
| 1309 | 1309 | static WRITE8_HANDLER( pc_cga8_w ) |
| 1310 | 1310 | { |
| 1311 | | device_t *devconf; |
| 1311 | mc6845_device *mc6845; |
| 1312 | 1312 | |
| 1313 | 1313 | switch(offset) { |
| 1314 | 1314 | case 0: case 2: case 4: case 6: |
| 1315 | | devconf = space->machine().device(CGA_MC6845_NAME); |
| 1316 | | mc6845_address_w( devconf, offset, data ); |
| 1315 | mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 1316 | mc6845->address_w( *space, offset, data ); |
| 1317 | 1317 | break; |
| 1318 | 1318 | case 1: case 3: case 5: case 7: |
| 1319 | | devconf = space->machine().device(CGA_MC6845_NAME); |
| 1320 | | mc6845_register_w( devconf, offset, data ); |
| 1319 | mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 1320 | mc6845->register_w( *space, offset, data ); |
| 1321 | 1321 | break; |
| 1322 | 1322 | case 8: |
| 1323 | 1323 | pc_cga_mode_control_w(space->machine(), data); |
| r11574 | r11575 | |
| 1613 | 1613 | static WRITE8_HANDLER ( pc1512_w ) |
| 1614 | 1614 | { |
| 1615 | 1615 | UINT8 *videoram = cga.videoram; |
| 1616 | | device_t *devconf = space->machine().device(CGA_MC6845_NAME); |
| 1616 | mc6845_device *mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 1617 | 1617 | |
| 1618 | 1618 | switch (offset) |
| 1619 | 1619 | { |
| 1620 | 1620 | case 0: case 2: case 4: case 6: |
| 1621 | 1621 | data &= 0x1F; |
| 1622 | | mc6845_address_w( devconf, offset, data ); |
| 1622 | mc6845->address_w( *space, offset, data ); |
| 1623 | 1623 | pc1512.mc6845_address = data; |
| 1624 | 1624 | break; |
| 1625 | 1625 | |
| 1626 | 1626 | case 1: case 3: case 5: case 7: |
| 1627 | 1627 | if ( ! pc1512.mc6845_locked_register[pc1512.mc6845_address] ) |
| 1628 | 1628 | { |
| 1629 | | mc6845_register_w( devconf, offset, data ); |
| 1629 | mc6845->register_w( *space, offset, data ); |
| 1630 | 1630 | if ( mc6845_writeonce_register[pc1512.mc6845_address] ) |
| 1631 | 1631 | { |
| 1632 | 1632 | pc1512.mc6845_locked_register[pc1512.mc6845_address] = 1; |
| r11574 | r11575 | |
| 1648 | 1648 | switch( cga.mode_control & 0x3F ) |
| 1649 | 1649 | { |
| 1650 | 1650 | case 0x08: case 0x09: case 0x0C: case 0x0D: |
| 1651 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1651 | mc6845->set_hpixels_per_column( 8 ); |
| 1652 | 1652 | cga.update_row = cga_text_inten_update_row; |
| 1653 | 1653 | break; |
| 1654 | 1654 | case 0x0A: case 0x0B: case 0x2A: case 0x2B: |
| 1655 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1655 | mc6845->set_hpixels_per_column( 8 ); |
| 1656 | 1656 | if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) |
| 1657 | 1657 | { |
| 1658 | 1658 | cga.update_row = cga_gfx_4bppl_update_row; |
| r11574 | r11575 | |
| 1663 | 1663 | } |
| 1664 | 1664 | break; |
| 1665 | 1665 | case 0x0E: case 0x0F: case 0x2E: case 0x2F: |
| 1666 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1666 | mc6845->set_hpixels_per_column( 8 ); |
| 1667 | 1667 | cga.update_row = cga_gfx_2bpp_update_row; |
| 1668 | 1668 | break; |
| 1669 | 1669 | case 0x18: case 0x19: case 0x1C: case 0x1D: |
| 1670 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1670 | mc6845->set_hpixels_per_column( 8 ); |
| 1671 | 1671 | cga.update_row = cga_text_inten_alt_update_row; |
| 1672 | 1672 | break; |
| 1673 | 1673 | case 0x1A: case 0x1B: case 0x3A: case 0x3B: |
| 1674 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1674 | mc6845->set_hpixels_per_column( 8 ); |
| 1675 | 1675 | cga.update_row = pc1512_gfx_4bpp_update_row; |
| 1676 | 1676 | break; |
| 1677 | 1677 | case 0x1E: case 0x1F: case 0x3E: case 0x3F: |
| 1678 | | mc6845_set_hpixels_per_column( devconf, 16 ); |
| 1678 | mc6845->set_hpixels_per_column( 16 ); |
| 1679 | 1679 | cga.update_row = cga_gfx_1bpp_update_row; |
| 1680 | 1680 | break; |
| 1681 | 1681 | case 0x28: case 0x29: case 0x2C: case 0x2D: |
| 1682 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1682 | mc6845->set_hpixels_per_column( 8 ); |
| 1683 | 1683 | cga.update_row = cga_text_blink_update_row; |
| 1684 | 1684 | break; |
| 1685 | 1685 | case 0x38: case 0x39: case 0x3C: case 0x3D: |
| 1686 | | mc6845_set_hpixels_per_column( devconf, 8 ); |
| 1686 | mc6845->set_hpixels_per_column( 8 ); |
| 1687 | 1687 | cga.update_row = cga_text_blink_alt_update_row; |
| 1688 | 1688 | break; |
| 1689 | 1689 | default: |
| r11574 | r11575 | |
| 1787 | 1787 | static SCREEN_UPDATE( mc6845_pc1512 ) |
| 1788 | 1788 | { |
| 1789 | 1789 | UINT8 *gfx = screen->machine().region("gfx1")->base(); |
| 1790 | | device_t *devconf = screen->machine().device(CGA_MC6845_NAME); |
| 1791 | | mc6845_update( devconf, bitmap, cliprect); |
| 1790 | mc6845_device *mc6845 = screen->machine().device<mc6845_device>(CGA_MC6845_NAME); |
| 1791 | mc6845->update(bitmap, cliprect); |
| 1792 | 1792 | |
| 1793 | 1793 | /* Check for changes in font dipsetting */ |
| 1794 | 1794 | switch ( CGA_FONT & 0x03 ) |
src/mess/video/ibm_vga.c
| r11574 | r11575 | |
| 15 | 15 | |
| 16 | 16 | #define CRTC_PORT_ADDR ((m_misc_out_reg & 1) ? 0x3d0 : 0x3b0 ) |
| 17 | 17 | |
| 18 | | UINT8 ibm_vga_device::vga_crtc_r(int offset) |
| 18 | READ8_MEMBER(ibm_vga_device::vga_crtc_r) |
| 19 | 19 | { |
| 20 | 20 | int data = 0xff; |
| 21 | 21 | switch( offset ) |
| r11574 | r11575 | |
| 24 | 24 | /* return last written mc6845 address value here? */ |
| 25 | 25 | break; |
| 26 | 26 | case 5: |
| 27 | | data = mc6845_register_r( m_crtc, offset ); |
| 27 | data = m_crtc->register_r( space, offset ); |
| 28 | 28 | break; |
| 29 | 29 | } |
| 30 | 30 | return data; |
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | | void ibm_vga_device::vga_crtc_w(int offset, UINT8 data) |
| 34 | WRITE8_MEMBER(ibm_vga_device::vga_crtc_w) |
| 35 | 35 | { |
| 36 | 36 | switch(offset) |
| 37 | 37 | { |
| 38 | 38 | case 4: |
| 39 | | mc6845_address_w( m_crtc, offset, data ); |
| 39 | m_crtc->address_w( space, offset, data ); |
| 40 | 40 | break; |
| 41 | 41 | case 5: |
| 42 | | mc6845_register_w( m_crtc, offset, data ); |
| 42 | m_crtc->register_w( space, offset, data ); |
| 43 | 43 | break; |
| 44 | 44 | } |
| 45 | 45 | } |
| r11574 | r11575 | |
| 48 | 48 | { |
| 49 | 49 | UINT8 retVal = 0xff; |
| 50 | 50 | if (CRTC_PORT_ADDR == 0x3b0) |
| 51 | | retVal = vga_crtc_r(offset); |
| 51 | retVal = vga_crtc_r(space, offset); |
| 52 | 52 | //if (LOG_ACCESSES) |
| 53 | 53 | //logerror("vga_port_03b0_r(): port=0x%04x data=0x%02x\n", offset + 0x3b0, retVal); |
| 54 | 54 | return retVal; |
| r11574 | r11575 | |
| 59 | 59 | //if (LOG_ACCESSES) |
| 60 | 60 | //logerror("vga_port_03b0_w(): port=0x%04x data=0x%02x\n", offset + 0x3b0, data); |
| 61 | 61 | if (CRTC_PORT_ADDR == 0x3b0) |
| 62 | | vga_crtc_w(offset, data); |
| 62 | vga_crtc_w(space, offset, data); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | READ8_MEMBER( ibm_vga_device::vga_port_03c0_r) |
| r11574 | r11575 | |
| 186 | 186 | { |
| 187 | 187 | UINT8 retVal = 0xff; |
| 188 | 188 | if (CRTC_PORT_ADDR == 0x3d0) |
| 189 | | retVal = vga_crtc_r(offset); |
| 189 | retVal = vga_crtc_r(space, offset); |
| 190 | 190 | //if (LOG_ACCESSES) |
| 191 | 191 | // logerror("vga_port_03d0_r(): port=0x%04x data=0x%02x\n", offset + 0x3d0, retVal); |
| 192 | 192 | return retVal; |
| r11574 | r11575 | |
| 197 | 197 | // if (LOG_ACCESSES) |
| 198 | 198 | //logerror("vga_port_03d0_w(): port=0x%04x data=0x%02x\n", offset + 0x3d0, data); |
| 199 | 199 | if (CRTC_PORT_ADDR == 0x3d0) |
| 200 | | vga_crtc_w(offset, data); |
| 200 | vga_crtc_w(space, offset, data); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| r11574 | r11575 | |
| 221 | 221 | |
| 222 | 222 | static SCREEN_UPDATE( mc6845_vga ) |
| 223 | 223 | { |
| 224 | | device_t *devconf = screen->owner()->subdevice(VGA_MC6845_NAME); |
| 225 | | mc6845_update( devconf, bitmap, cliprect); |
| 224 | mc6845_device *mc6845 = screen->owner()->subdevice<mc6845_device>(VGA_MC6845_NAME); |
| 225 | mc6845->update(bitmap, cliprect); |
| 226 | 226 | return 0; |
| 227 | 227 | } |
| 228 | 228 | |
src/mess/drivers/mycom.c
| r11574 | r11575 | |
| 86 | 86 | required_device<i8255_device> m_ppi2; |
| 87 | 87 | required_device<device_t> m_cass; |
| 88 | 88 | required_device<device_t> m_wave; |
| 89 | | required_device<device_t> m_crtc; |
| 89 | required_device<mc6845_device> m_crtc; |
| 90 | 90 | required_device<device_t> m_fdc; |
| 91 | 91 | required_device<device_t> m_audio; |
| 92 | 92 | required_device<msm5832_device> m_rtc; |
| r11574 | r11575 | |
| 126 | 126 | |
| 127 | 127 | SCREEN_UPDATE_MEMBER( mycom_state ) |
| 128 | 128 | { |
| 129 | | mc6845_update(m_crtc, &bitmap, &cliprect); |
| 129 | m_crtc->update( &bitmap, &cliprect); |
| 130 | 130 | return 0; |
| 131 | 131 | } |
| 132 | 132 | |
| r11574 | r11575 | |
| 227 | 227 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 228 | 228 | AM_RANGE(0x00, 0x00) AM_WRITE(mycom_00_w) |
| 229 | 229 | AM_RANGE(0x01, 0x01) AM_READWRITE(vram_data_r,vram_data_w) |
| 230 | | AM_RANGE(0x02, 0x02) AM_DEVREADWRITE_LEGACY("crtc", mc6845_status_r,mc6845_address_w) |
| 231 | | AM_RANGE(0x03, 0x03) AM_DEVREADWRITE_LEGACY("crtc", mc6845_register_r,mc6845_register_w) |
| 230 | AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w) |
| 231 | AM_RANGE(0x03, 0x03) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 232 | 232 | AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 233 | 233 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) |
| 234 | 234 | AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write) |
| r11574 | r11575 | |
| 430 | 430 | cassette_output(m_cass, BIT(data, 2) ? -1.0 : +1.0); |
| 431 | 431 | |
| 432 | 432 | if ( (BIT(data, 7)) != (BIT(m_0a, 7)) ) |
| 433 | | mc6845_set_clock(m_crtc, BIT(data, 7) ? 1008000 : 2016000); |
| 433 | m_crtc->set_clock(BIT(data, 7) ? 1008000 : 2016000); |
| 434 | 434 | |
| 435 | 435 | m_0a = data; |
| 436 | 436 | |
src/mess/drivers/pet.c
| r11574 | r11575 | |
| 419 | 419 | AM_RANGE(0xe810, 0xe813) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 420 | 420 | AM_RANGE(0xe820, 0xe823) AM_DEVREADWRITE_MODERN("pia_1", pia6821_device, read, write) |
| 421 | 421 | AM_RANGE(0xe840, 0xe84f) AM_DEVREADWRITE_MODERN("via6522_0", via6522_device, read, write) |
| 422 | | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE("crtc", mc6845_address_w) |
| 423 | | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 422 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 423 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 424 | 424 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 425 | 425 | ADDRESS_MAP_END |
| 426 | 426 | |
| r11574 | r11575 | |
| 436 | 436 | AM_RANGE(0xe810, 0xe813) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w) |
| 437 | 437 | AM_RANGE(0xe820, 0xe823) AM_DEVREADWRITE("pia_1", pia6821_r, pia6821_w) |
| 438 | 438 | AM_RANGE(0xe840, 0xe84f) AM_DEVREADWRITE_MODERN("via6522_0", via6522_device, read, write) |
| 439 | | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE("crtc", mc6845_address_w) |
| 440 | | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 439 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 440 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 441 | 441 | #endif |
| 442 | 442 | AM_RANGE(0xf000, 0xffff) AM_READ_BANK("bank8") |
| 443 | 443 | AM_RANGE(0xf000, 0xffef) AM_WRITE_BANK("bank8") |
| r11574 | r11575 | |
| 467 | 467 | AM_RANGE(0xe810, 0xe813) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 468 | 468 | AM_RANGE(0xe820, 0xe823) AM_DEVREADWRITE_MODERN("pia_1", pia6821_device, read, write) |
| 469 | 469 | AM_RANGE(0xe840, 0xe84f) AM_DEVREADWRITE_MODERN("via6522_0", via6522_device, read, write) |
| 470 | | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE("crtc", mc6845_address_w) |
| 471 | | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 470 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 471 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 472 | 472 | /* 0xefe0, 0xefe3, mos 6702 */ |
| 473 | 473 | /* 0xeff0, 0xeff3, acia6551 */ |
| 474 | 474 | AM_RANGE(0xeff8, 0xefff) AM_READWRITE(superpet_r, superpet_w) |
| r11574 | r11575 | |
| 483 | 483 | AM_RANGE(0xe810, 0xe813) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 484 | 484 | AM_RANGE(0xe820, 0xe823) AM_DEVREADWRITE_MODERN("pia_1", pia6821_device, read, write) |
| 485 | 485 | AM_RANGE(0xe840, 0xe84f) AM_DEVREADWRITE_MODERN("via6522_0", via6522_device, read, write) |
| 486 | | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE("crtc", mc6845_address_w) |
| 487 | | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 486 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 487 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 488 | 488 | AM_RANGE(0xeff8, 0xefff) AM_READWRITE(superpet_r, superpet_w) |
| 489 | 489 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 490 | 490 | ADDRESS_MAP_END |
| r11574 | r11575 | |
| 641 | 641 | |
| 642 | 642 | static SCREEN_UPDATE( pet_crtc ) |
| 643 | 643 | { |
| 644 | | device_t *mc6845 = screen->machine().device("crtc"); |
| 645 | | mc6845_update(mc6845, bitmap, cliprect); |
| 644 | mc6845_device *mc6845 = screen->machine().device<mc6845_device>("crtc"); |
| 645 | mc6845->update( bitmap, cliprect); |
| 646 | 646 | return 0; |
| 647 | 647 | } |
| 648 | 648 | |
src/mess/drivers/abc80x.c
| r11574 | r11575 | |
| 702 | 702 | |
| 703 | 703 | static ADDRESS_MAP_START( abc800m_io, AS_IO, 8, abc800_state ) |
| 704 | 704 | AM_IMPORT_FROM( abc800c_io ) |
| 705 | | AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r) |
| 706 | | AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w) |
| 707 | | AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w) |
| 705 | AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 706 | AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| 707 | AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w) |
| 708 | 708 | ADDRESS_MAP_END |
| 709 | 709 | |
| 710 | 710 | |
| r11574 | r11575 | |
| 736 | 736 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_READ(pling_r) |
| 737 | 737 | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_device, rst_r) |
| 738 | 738 | AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 739 | | AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r) |
| 740 | | AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w) |
| 741 | | AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w) |
| 739 | AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 740 | AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| 741 | AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w) |
| 742 | 742 | AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 743 | 743 | AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80CTC_TAG, z80ctc_r, z80ctc_w) |
| 744 | 744 | ADDRESS_MAP_END |
| r11574 | r11575 | |
| 784 | 784 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xff18) AM_WRITE(hrs_w) |
| 785 | 785 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff18) AM_DEVREAD(ABCBUS_TAG, abcbus_device, rst_r) AM_WRITE(hrc_w) |
| 786 | 786 | AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 787 | | AM_RANGE(0x31, 0x31) AM_MIRROR(0xff06) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r) |
| 787 | AM_RANGE(0x31, 0x31) AM_MIRROR(0xff06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 788 | 788 | AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(mai_r, mao_w) |
| 789 | 789 | AM_RANGE(0x35, 0x35) AM_MIRROR(0xff00) AM_READWRITE(ami_r, amo_w) |
| 790 | 790 | AM_RANGE(0x36, 0x36) AM_MIRROR(0xff00) AM_READWRITE(sti_r, sto_w) |
| 791 | 791 | AM_RANGE(0x37, 0x37) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(cli_r, sso_w) |
| 792 | | AM_RANGE(0x38, 0x38) AM_MIRROR(0xff06) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w) |
| 793 | | AM_RANGE(0x39, 0x39) AM_MIRROR(0xff06) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w) |
| 792 | AM_RANGE(0x38, 0x38) AM_MIRROR(0xff06) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| 793 | AM_RANGE(0x39, 0x39) AM_MIRROR(0xff06) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w) |
| 794 | 794 | AM_RANGE(0x40, 0x43) AM_MIRROR(0xff1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 795 | 795 | AM_RANGE(0x60, 0x63) AM_MIRROR(0xff1c) AM_DEVREADWRITE_LEGACY(Z80CTC_TAG, z80ctc_r, z80ctc_w) |
| 796 | 796 | ADDRESS_MAP_END |
src/mess/drivers/camplynx.c
| r11574 | r11575 | |
| 87 | 87 | camplynx_state(const machine_config &mconfig, device_type type, const char *tag) |
| 88 | 88 | : driver_device(mconfig, type, tag) { } |
| 89 | 89 | |
| 90 | | device_t *m_mc6845; |
| 90 | mc6845_device *m_mc6845; |
| 91 | 91 | }; |
| 92 | 92 | |
| 93 | 93 | /* These bankswitch handlers are very incomplete, just enough to get the |
| r11574 | r11575 | |
| 198 | 198 | AM_RANGE(0x0880,0x0880) AM_READ_PORT("LINE8") |
| 199 | 199 | AM_RANGE(0x0980,0x0980) AM_READ_PORT("LINE9") |
| 200 | 200 | AM_RANGE(0x0084,0x0084) AM_MIRROR(0xff00) AM_DEVWRITE("dac", dac_w) /* 6-bit dac */ |
| 201 | | AM_RANGE(0x0086,0x0086) AM_MIRROR(0xff00) AM_DEVWRITE("crtc", mc6845_address_w) |
| 202 | | AM_RANGE(0x0087,0x0087) AM_MIRROR(0xff00) AM_DEVREADWRITE("crtc", mc6845_register_r,mc6845_register_w) |
| 201 | AM_RANGE(0x0086,0x0086) AM_MIRROR(0xff00) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 202 | AM_RANGE(0x0087,0x0087) AM_MIRROR(0xff00) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 203 | 203 | ADDRESS_MAP_END |
| 204 | 204 | |
| 205 | 205 | static ADDRESS_MAP_START( lynx128k_io , AS_IO, 8) |
| r11574 | r11575 | |
| 224 | 224 | AM_RANGE(0x0980,0x0980) AM_READ_PORT("LINE9") |
| 225 | 225 | AM_RANGE(0x0082,0x0082) AM_MIRROR(0xff00) AM_WRITE(lynx128k_bank_w) // read=serial buffer |
| 226 | 226 | AM_RANGE(0x0084,0x0084) AM_MIRROR(0xff00) AM_DEVWRITE("dac", dac_w) /* 6-bit dac. Read="single-step", causes a NMI */ |
| 227 | | AM_RANGE(0x0086,0x0086) AM_MIRROR(0xff00) AM_DEVREADWRITE("crtc", mc6845_status_r,mc6845_address_w) |
| 228 | | AM_RANGE(0x0087,0x0087) AM_MIRROR(0xff00) AM_DEVREADWRITE("crtc", mc6845_register_r,mc6845_register_w) |
| 227 | AM_RANGE(0x0086,0x0086) AM_MIRROR(0xff00) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, status_r, address_w) |
| 228 | AM_RANGE(0x0087,0x0087) AM_MIRROR(0xff00) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 229 | 229 | ADDRESS_MAP_END |
| 230 | 230 | |
| 231 | 231 | /* Input ports */ |
| r11574 | r11575 | |
| 411 | 411 | { |
| 412 | 412 | camplynx_state *state = machine.driver_data<camplynx_state>(); |
| 413 | 413 | |
| 414 | | state->m_mc6845 = machine.device("crtc"); |
| 414 | state->m_mc6845 = machine.device<mc6845_device>("crtc"); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | static SCREEN_UPDATE( lynx48k ) |
| 418 | 418 | { |
| 419 | 419 | camplynx_state *state = screen->machine().driver_data<camplynx_state>(); |
| 420 | 420 | |
| 421 | | mc6845_update(state->m_mc6845, bitmap, cliprect); |
| 421 | state->m_mc6845->update( bitmap, cliprect); |
| 422 | 422 | return 0; |
| 423 | 423 | } |
| 424 | 424 | |
src/mess/drivers/abc1600.c
| r11574 | r11575 | |
| 208 | 208 | |
| 209 | 209 | case CRT: |
| 210 | 210 | if (A0) |
| 211 | | data = mc6845_register_r(m_crtc, 0); |
| 211 | data = m_crtc->register_r( *program, offset ); |
| 212 | 212 | else |
| 213 | | data = mc6845_status_r(m_crtc, 0); |
| 213 | data = m_crtc->status_r( *program, offset ); |
| 214 | 214 | break; |
| 215 | 215 | |
| 216 | 216 | case DRT: |
| r11574 | r11575 | |
| 311 | 311 | |
| 312 | 312 | case CRT: |
| 313 | 313 | if (A0) |
| 314 | | mc6845_register_w(m_crtc, 0, data); |
| 314 | m_crtc->register_w(*program, offset, data); |
| 315 | 315 | else |
| 316 | | mc6845_address_w(m_crtc, 0, data); |
| 316 | m_crtc->address_w(*program, offset, data); |
| 317 | 317 | break; |
| 318 | 318 | |
| 319 | 319 | case DRT: |
| r11574 | r11575 | |
| 1004 | 1004 | AM_RANGE(0x000000, 0x0fffff) AM_RAM |
| 1005 | 1005 | AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_MEMBER(m_video_ram) |
| 1006 | 1006 | AM_RANGE(0x1ff000, 0x1ff007) AM_DEVREADWRITE_LEGACY(SAB1797_02P_TAG, wd17xx_r, wd17xx_w) // A2,A1 |
| 1007 | | AM_RANGE(0x1ff100, 0x1ff100) AM_DEVWRITE_LEGACY(SY6845E_TAG, mc6845_address_w) |
| 1008 | | AM_RANGE(0x1ff101, 0x1ff101) AM_DEVREADWRITE_LEGACY(SY6845E_TAG, mc6845_register_r, mc6845_register_w) |
| 1007 | AM_RANGE(0x1ff100, 0x1ff100) AM_DEVWRITE(SY6845E_TAG, mc6845_device, address_w) |
| 1008 | AM_RANGE(0x1ff101, 0x1ff101) AM_DEVREADWRITE(SY6845E_TAG, mc6845_device, register_r, register_w) |
| 1009 | 1009 | AM_RANGE(0x1ff200, 0x1ff207) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) // A2,A1 |
| 1010 | 1010 | AM_RANGE(0x1ff300, 0x1ff300) AM_DEVREADWRITE_LEGACY(Z8410AB1_0_TAG, z80dma_r, z80dma_w) |
| 1011 | 1011 | AM_RANGE(0x1ff400, 0x1ff400) AM_DEVREADWRITE_LEGACY(Z8410AB1_1_TAG, z80dma_r, z80dma_w) |
src/mess/drivers/prof80.c
| r11574 | r11575 | |
| 622 | 622 | AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE_LEGACY(Z80STI_TAG, z80sti_r, z80sti_w) |
| 623 | 623 | AM_RANGE(0x30, 0x30) AM_READWRITE(lrs_r, lrs_w) |
| 624 | 624 | AM_RANGE(0x40, 0x40) AM_READ(stat_r) |
| 625 | | AM_RANGE(0x50, 0x50) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w) |
| 626 | | AM_RANGE(0x52, 0x52) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w) |
| 627 | | AM_RANGE(0x53, 0x53) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r) |
| 625 | AM_RANGE(0x50, 0x50) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| 626 | AM_RANGE(0x52, 0x52) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w) |
| 627 | AM_RANGE(0x53, 0x53) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 628 | 628 | AM_RANGE(0x60, 0x60) AM_DEVWRITE_LEGACY(CENTRONICS_TAG, centronics_data_w) |
| 629 | 629 | AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(I8255A_TAG, i8255_device, read, write) |
| 630 | 630 | // AM_RANGE(0x80, 0x80) AM_WRITE(bl2out_w) |
| r11574 | r11575 | |
| 651 | 651 | AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE_LEGACY(Z80STI_TAG, z80sti_r, z80sti_w) |
| 652 | 652 | AM_RANGE(0x30, 0x30) AM_READWRITE(lrs_r, lrs_w) |
| 653 | 653 | AM_RANGE(0x40, 0x40) AM_READ(stat_r) |
| 654 | | AM_RANGE(0x50, 0x50) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w) |
| 655 | | AM_RANGE(0x52, 0x52) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_register_w) |
| 656 | | AM_RANGE(0x53, 0x53) AM_DEVREAD_LEGACY(MC6845_TAG, mc6845_register_r) |
| 654 | AM_RANGE(0x50, 0x50) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| 655 | AM_RANGE(0x52, 0x52) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w) |
| 656 | AM_RANGE(0x53, 0x53) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 657 | 657 | AM_RANGE(0x60, 0x60) AM_DEVWRITE_LEGACY(CENTRONICS_TAG, centronics_data_w) |
| 658 | 658 | AM_RANGE(0x70, 0x73) AM_DEVREADWRITE(I8255A_TAG, i8255_device, read, write) |
| 659 | 659 | |
| r11574 | r11575 | |
| 959 | 959 | |
| 960 | 960 | bool grip_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 961 | 961 | { |
| 962 | | mc6845_update(m_crtc, &bitmap, &cliprect); |
| 962 | m_crtc->update( &bitmap, &cliprect); |
| 963 | 963 | |
| 964 | 964 | return 0; |
| 965 | 965 | } |
src/mess/drivers/victor9k.c
| r11574 | r11575 | |
| 32 | 32 | AM_RANGE(0xe0000, 0xe0001) AM_DEVREADWRITE_LEGACY(I8259A_TAG, pic8259_r, pic8259_w) |
| 33 | 33 | AM_RANGE(0xe0020, 0xe0023) AM_DEVREADWRITE_LEGACY(I8253_TAG, pit8253_r, pit8253_w) |
| 34 | 34 | AM_RANGE(0xe0040, 0xe0043) AM_DEVREADWRITE(UPD7201_TAG, upd7201_device, cd_ba_r, cd_ba_w) |
| 35 | | AM_RANGE(0xe8000, 0xe8000) AM_DEVREADWRITE_LEGACY(HD46505S_TAG, mc6845_status_r, mc6845_address_w) |
| 36 | | AM_RANGE(0xe8001, 0xe8001) AM_DEVREADWRITE_LEGACY(HD46505S_TAG, mc6845_register_r, mc6845_register_w) |
| 35 | AM_RANGE(0xe8000, 0xe8000) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, status_r, address_w) |
| 36 | AM_RANGE(0xe8001, 0xe8001) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, register_r, register_w) |
| 37 | 37 | AM_RANGE(0xe8020, 0xe802f) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write) |
| 38 | 38 | AM_RANGE(0xe8040, 0xe804f) AM_DEVREADWRITE(M6522_2_TAG, via6522_device, read, write) |
| 39 | 39 | AM_RANGE(0xe8060, 0xe8061) AM_DEVREADWRITE(MC6852_TAG, mc6852_device, read, write) |
| r11574 | r11575 | |
| 128 | 128 | |
| 129 | 129 | bool victor9k_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 130 | 130 | { |
| 131 | | mc6845_update(m_crtc, &bitmap, &cliprect); |
| 131 | m_crtc->update(&bitmap, &cliprect); |
| 132 | 132 | |
| 133 | 133 | return 0; |
| 134 | 134 | } |
src/mess/drivers/apricot.c
| r11574 | r11575 | |
| 33 | 33 | |
| 34 | 34 | device_t *m_pic8259; |
| 35 | 35 | device_t *m_wd2793; |
| 36 | | device_t *m_mc6845; |
| 36 | mc6845_device *m_mc6845; |
| 37 | 37 | |
| 38 | 38 | int m_video_mode; |
| 39 | 39 | int m_display_on; |
| r11574 | r11575 | |
| 65 | 65 | if (!BIT(data, 5)) wd17xx_set_drive(state->m_wd2793, BIT(data, 6)); |
| 66 | 66 | |
| 67 | 67 | /* switch video modes */ |
| 68 | | mc6845_set_clock(state->m_mc6845, state->m_video_mode ? XTAL_15MHz / 10 : XTAL_15MHz / 16); |
| 69 | | mc6845_set_hpixels_per_column(state->m_mc6845, state->m_video_mode ? 10 : 16); |
| 68 | state->m_mc6845->set_clock( state->m_video_mode ? XTAL_15MHz / 10 : XTAL_15MHz / 16); |
| 69 | state->m_mc6845->set_hpixels_per_column( state->m_video_mode ? 10 : 16); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static const i8255_interface apricot_i8255a_intf = |
| r11574 | r11575 | |
| 168 | 168 | apricot_state *state = screen->machine().driver_data<apricot_state>(); |
| 169 | 169 | |
| 170 | 170 | if (!state->m_display_on) |
| 171 | | mc6845_update(state->m_mc6845, bitmap, cliprect); |
| 171 | state->m_mc6845->update( bitmap, cliprect); |
| 172 | 172 | else |
| 173 | 173 | bitmap_fill(bitmap, cliprect, 0); |
| 174 | 174 | |
| r11574 | r11575 | |
| 251 | 251 | |
| 252 | 252 | state->m_pic8259 = machine.device("ic31"); |
| 253 | 253 | state->m_wd2793 = machine.device("ic68"); |
| 254 | | state->m_mc6845 = machine.device("ic30"); |
| 254 | state->m_mc6845 = machine.device<mc6845_device>("ic30"); |
| 255 | 255 | |
| 256 | 256 | state->m_video_mode = 0; |
| 257 | 257 | state->m_display_on = 1; |
| r11574 | r11575 | |
| 276 | 276 | AM_RANGE(0x50, 0x51) AM_MIRROR(0x06) AM_DEVWRITE8("ic7", sn76496_w, 0x00ff) |
| 277 | 277 | AM_RANGE(0x58, 0x5f) AM_DEVREADWRITE8("ic16", pit8253_r, pit8253_w, 0x00ff) |
| 278 | 278 | AM_RANGE(0x60, 0x67) AM_DEVREADWRITE8("ic15", z80sio_ba_cd_r, z80sio_ba_cd_w, 0x00ff) |
| 279 | | AM_RANGE(0x68, 0x69) AM_MIRROR(0x04) AM_DEVWRITE8("ic30", mc6845_address_w, 0x00ff) |
| 280 | | AM_RANGE(0x6a, 0x6b) AM_MIRROR(0x04) AM_DEVREADWRITE8("ic30", mc6845_register_r, mc6845_register_w, 0x00ff) |
| 279 | AM_RANGE(0x68, 0x69) AM_MIRROR(0x04) AM_DEVWRITE8_MODERN("ic30", mc6845_device, address_w, 0x00ff) |
| 280 | AM_RANGE(0x6a, 0x6b) AM_MIRROR(0x04) AM_DEVREADWRITE8_MODERN("ic30", mc6845_device, register_r, register_w, 0x00ff) |
| 281 | 281 | // AM_RANGE(0x70, 0x71) AM_MIRROR(0x04) 8089 channel attention 1 |
| 282 | 282 | // AM_RANGE(0x72, 0x73) AM_MIRROR(0x04) 8089 channel attention 2 |
| 283 | 283 | AM_RANGE(0x78, 0x7f) AM_NOP /* unavailable */ |
src/mess/drivers/dim68k.c
| r11574 | r11575 | |
| 52 | 52 | { } |
| 53 | 53 | |
| 54 | 54 | required_device<cpu_device> m_maincpu; |
| 55 | | required_device<device_t> m_crtc; |
| 55 | required_device<mc6845_device> m_crtc; |
| 56 | 56 | required_device<device_t> m_speaker; |
| 57 | 57 | DECLARE_READ16_MEMBER( dim68k_duart_r ); |
| 58 | 58 | DECLARE_READ16_MEMBER( dim68k_fdc_r ); |
| r11574 | r11575 | |
| 131 | 131 | D1 0 = Standard Chars & LoRes; 1 = Alternate Chars & HiRes [not emulated yet] |
| 132 | 132 | D0 0 = Non-Mixed (all text or all Graphics); 1 = Mixed (Colour Graphics and Monochrome Text) [not emulated yet] |
| 133 | 133 | */ |
| 134 | | mc6845_set_hpixels_per_column(m_crtc, (data & 0x40) ? 7 : 8); |
| 134 | m_crtc->set_hpixels_per_column((data & 0x40) ? 7 : 8); |
| 135 | 135 | m_video_control = data; |
| 136 | 136 | |
| 137 | 137 | switch (data & 0x18) |
| 138 | 138 | { |
| 139 | | case 0x00: mc6845_set_clock(m_crtc, XTAL_14MHz); |
| 139 | case 0x00: m_crtc->set_clock(XTAL_14MHz); |
| 140 | 140 | break; |
| 141 | | case 0x08: mc6845_set_clock(m_crtc, XTAL_3_579545MHz); |
| 141 | case 0x08: m_crtc->set_clock(XTAL_3_579545MHz); |
| 142 | 142 | break; |
| 143 | | case 0x10: mc6845_set_clock(m_crtc, XTAL_14MHz / 2); |
| 143 | case 0x10: m_crtc->set_clock(XTAL_14MHz / 2); |
| 144 | 144 | break; |
| 145 | | case 0x18: mc6845_set_clock(m_crtc, XTAL_3_579545MHz / 2); |
| 145 | case 0x18: m_crtc->set_clock(XTAL_3_579545MHz / 2); |
| 146 | 146 | break; |
| 147 | 147 | } |
| 148 | 148 | } |
| r11574 | r11575 | |
| 175 | 175 | AM_RANGE(0x00000000, 0x00feffff) AM_RAM AM_BASE(m_ram) // 16MB RAM / ROM at boot |
| 176 | 176 | AM_RANGE(0x00ff0000, 0x00ff1fff) AM_ROM AM_REGION("bootrom", 0) |
| 177 | 177 | AM_RANGE(0x00ff2000, 0x00ff7fff) AM_RAM // Graphics Video RAM |
| 178 | | AM_RANGE(0x00ff8000, 0x00ff8001) AM_DEVREADWRITE8_LEGACY("crtc", mc6845_status_r, mc6845_address_w, 0xff) |
| 179 | | AM_RANGE(0x00ff8002, 0x00ff8003) AM_DEVREADWRITE8_LEGACY("crtc", mc6845_register_r, mc6845_register_w, 0xff) |
| 178 | AM_RANGE(0x00ff8000, 0x00ff8001) AM_DEVREADWRITE8("crtc", mc6845_device, status_r, address_w, 0xff) |
| 179 | AM_RANGE(0x00ff8002, 0x00ff8003) AM_DEVREADWRITE8("crtc", mc6845_device, register_r, register_w, 0xff) |
| 180 | 180 | AM_RANGE(0x00ff8004, 0x00ff8005) AM_WRITE(dim68k_video_high_w) |
| 181 | 181 | AM_RANGE(0x00ff8008, 0x00ff8009) AM_WRITE(dim68k_video_control_w) |
| 182 | 182 | AM_RANGE(0x00ff800a, 0x00ff800b) AM_WRITE(dim68k_video_reset_w) |
| r11574 | r11575 | |
| 218 | 218 | |
| 219 | 219 | SCREEN_UPDATE_MEMBER( dim68k_state ) |
| 220 | 220 | { |
| 221 | | mc6845_update(m_crtc, &bitmap, &cliprect); |
| 221 | m_crtc->update( &bitmap, &cliprect); |
| 222 | 222 | return 0; |
| 223 | 223 | } |
| 224 | 224 | |
src/mess/drivers/pyl601.c
| r11574 | r11575 | |
| 218 | 218 | AM_RANGE( 0x0000, 0xbfff ) AM_RAMBANK("bank1") |
| 219 | 219 | AM_RANGE( 0xc000, 0xdfff ) AM_RAMBANK("bank2") |
| 220 | 220 | AM_RANGE( 0xe000, 0xe5ff ) AM_RAMBANK("bank3") |
| 221 | | AM_RANGE( 0xe600, 0xe600 ) AM_DEVWRITE("crtc", mc6845_address_w) |
| 222 | | AM_RANGE( 0xe601, 0xe601 ) AM_DEVREADWRITE("crtc", mc6845_register_r , mc6845_register_w) |
| 223 | | AM_RANGE( 0xe604, 0xe604 ) AM_DEVWRITE("crtc", mc6845_address_w) |
| 224 | | AM_RANGE( 0xe605, 0xe605 ) AM_DEVREADWRITE("crtc", mc6845_register_r , mc6845_register_w) |
| 221 | AM_RANGE( 0xe600, 0xe600 ) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 222 | AM_RANGE( 0xe601, 0xe601 ) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 223 | AM_RANGE( 0xe604, 0xe604 ) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w) |
| 224 | AM_RANGE( 0xe605, 0xe605 ) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w) |
| 225 | 225 | AM_RANGE( 0xe628, 0xe628 ) AM_READ(keyboard_r) |
| 226 | 226 | AM_RANGE( 0xe629, 0xe629 ) AM_READWRITE(video_mode_r,video_mode_w) |
| 227 | 227 | AM_RANGE( 0xe62a, 0xe62a ) AM_READWRITE(keycheck_r,led_w) |
| r11574 | r11575 | |
| 361 | 361 | |
| 362 | 362 | static SCREEN_UPDATE( pyl601 ) |
| 363 | 363 | { |
| 364 | | device_t *mc6845 = screen->machine().device("crtc"); |
| 365 | | mc6845_update(mc6845, bitmap, cliprect); |
| 364 | mc6845_device *mc6845 = screen->machine().device<mc6845_device>("crtc"); |
| 365 | mc6845->update( bitmap, cliprect); |
| 366 | 366 | return 0; |
| 367 | 367 | } |
| 368 | 368 | |