src/mess/machine/amstrad.c
| r15066 | r15067 | |
| 577 | 577 | amstrad_plus_dma_parse( machine, 2 ); |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | static TIMER_CALLBACK(amstrad_video_update_timer) |
| 581 | { |
| 582 | if(param == 1) |
| 583 | amstrad_plus_update_video(machine); |
| 584 | else |
| 585 | amstrad_update_video(machine); |
| 586 | } |
| 580 | 587 | |
| 581 | 588 | /* Set the new colour from the GateArray */ |
| 582 | 589 | static void amstrad_vh_update_colour(running_machine &machine, int PenIndex, UINT16 hw_colour_index) |
| r15066 | r15067 | |
| 586 | 593 | { |
| 587 | 594 | int val; |
| 588 | 595 | |
| 589 | | amstrad_plus_update_video( machine ); |
| 596 | machine.scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),1); |
| 590 | 597 | |
| 591 | 598 | /* CPC+/GX4000 - normal palette changes through the Gate Array also makes the corresponding change in the ASIC palette */ |
| 592 | 599 | val = (amstrad_palette[hw_colour_index] & 0xf00000) >> 16; /* red */ |
| r15066 | r15067 | |
| 597 | 604 | } |
| 598 | 605 | else |
| 599 | 606 | { |
| 600 | | amstrad_update_video( machine ); |
| 607 | machine.scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),0); |
| 601 | 608 | } |
| 602 | 609 | state->m_GateArray_render_colours[PenIndex] = hw_colour_index; |
| 603 | 610 | } |
| r15066 | r15067 | |
| 606 | 613 | static void aleste_vh_update_colour(running_machine &machine, int PenIndex, UINT16 hw_colour_index) |
| 607 | 614 | { |
| 608 | 615 | amstrad_state *state = machine.driver_data<amstrad_state>(); |
| 609 | | amstrad_update_video( machine ); |
| 616 | machine.scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),0); |
| 610 | 617 | state->m_GateArray_render_colours[PenIndex] = hw_colour_index+32; |
| 611 | 618 | } |
| 612 | 619 | |
| r15066 | r15067 | |
| 630 | 637 | amstrad_state *state = machine.driver_data<amstrad_state>(); |
| 631 | 638 | attotime now = machine.time(); |
| 632 | 639 | |
| 640 | |
| 633 | 641 | if ( state->m_gate_array.draw_p ) |
| 634 | 642 | { |
| 635 | 643 | UINT32 cycles_passed = (now - state->m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); |
| r15066 | r15067 | |
| 1962 | 1970 | m_prev_data = data; |
| 1963 | 1971 | } |
| 1964 | 1972 | |
| 1965 | | |
| 1966 | 1973 | /* Offset handler for write */ |
| 1967 | 1974 | WRITE8_MEMBER(amstrad_state::amstrad_cpc_io_w) |
| 1968 | 1975 | { |
| r15066 | r15067 | |
| 2006 | 2013 | break; |
| 2007 | 2014 | case 0x01: /* Write to selected internal 6845 register Write Only */ |
| 2008 | 2015 | if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 ) |
| 2009 | | amstrad_plus_update_video(machine()); |
| 2016 | machine().scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),1); |
| 2010 | 2017 | else |
| 2011 | | amstrad_update_video(machine()); |
| 2018 | machine().scheduler().timer_set( attotime::from_usec(1), FUNC(amstrad_video_update_timer),0); |
| 2012 | 2019 | mc6845->register_w( space, 0, data ); |
| 2013 | 2020 | |
| 2014 | 2021 | /* printer port bit 8 */ |